public interface ModuleActivator
ModuleActivator is an interface that may be implemented when a module
is started or stopped. The Runtime can create instances of a module's
ModuleActivator as required. If an instance's
ModuleActivator.start method executes successfully, it is guaranteed
that the same instance's ModuleActivator.stop method will be called
when the module is to be stopped. The Runtime must not concurrently call a
ModuleActivator object.
ModuleActivator is specified through the Module-Activator
module header.
The specified ModuleActivator class must have a public constructor
that takes no parameters so that a ModuleActivator object can be
created by Class.newInstance().
| Modifier and Type | Method and Description |
|---|---|
void |
start(ModuleContext context)
Called when this module is started so the Runtime can perform the
module-specific activities necessary to start this module.
|
void |
stop(ModuleContext context)
Called when this module is stopped so the Runtime can perform the
module-specific activities necessary to stop the module.
|
void start(ModuleContext context) throws Exception
This method must complete and return to its caller in a timely manner.
context - The execution context of the module being started.Exception - If this method throws an exception, this module is
marked as stopped and the Runtime will remove this module's
listeners, unregister all services registered by this module, and
release all services used by this module.void stop(ModuleContext context) throws Exception
ModuleActivator.start method
started. There should be no active threads that were started by this
module when this module returns. A stopped module must not call any
Runtime objects.
This method must complete and return to its caller in a timely manner.
context - The execution context of the module being stopped.Exception - If this method throws an exception, the module is still
marked as stopped, and the Runtime will remove the module's
listeners, unregister all services registered by the module, and
release all services used by the module.Copyright © 2015 JBoss by Red Hat. All rights reserved.