public interface Startable
All services in River now implement Startable to avoid exporting a service during construction, for JMM compliance.
ServiceDescriptor
,
ActivateWrapper
,
SharedGroupImpl
,
NonActivatableServiceDescriptor
,
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 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.