public interface Startable
All services in River now implement Startable to avoid exporting a service during construction, for JMM compliance.
see org.apache.river.start.ServiceDescriptor
see org.apache.river.start.ActivateWrapper
see org.apache.river.start.group.SharedGroupImpl
see org.apache.river.start.NonActivatableServiceDescriptor
see net.jini.export.Exporter
Modifier and Type | Method and Description |
---|---|
void |
start()
Called after construction, this method enables objects to delay
starting threads or exporting until after construction is complete,
to allow safe publication of the service in accordance with the JMM.
|
void start() throws Exception
In addition to starting threads after construction, it also allows objects to avoid throwing an exception during construction to avoid finalizer attacks.
The implementation is required to ensure start() is idempotent (only executed once, additional invocations must return immediately).
Exception
- if there's a problem with construction or startup.Copyright © 2016–2018. All rights reserved.