|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ComponentLifeCycle
This interface must be implemented by a JBI component to provide initialization,
start, stop, and shutdown life cycle processing. These methods comprise the life
cycle contract between the JBI implementation and the component. The life cycle
of a component begins with a call to the init() method on an instance of the
component's implementation of this interface, and ends with the first call to the
shutDown() method on that instance. Between these two calls, there can be any
number of stop() and start() calls.
The JBI implementation must track the running state of a component, and ensure
that life cycle state changes are always legal. For example, if the management
interface for controlling a component's life cycle (ComponentLifeCycleMBean
) is used to start a component that
was just installed (and thus in the Shutdown state), the implementation
must invoke this component's init(ComponentContext)
method before
invoking its start()
method.
Method Summary | |
---|---|
ObjectName |
getExtensionMBeanName()
Get the JMX object name for the extension MBean for this component; if there is none, return null. |
void |
init(ComponentContext context)
Initialize the component. |
void |
shutDown()
Shut down the component. |
void |
start()
Start the component. |
void |
stop()
Stop the component. |
Method Detail |
---|
ObjectName getExtensionMBeanName()
void init(ComponentContext context) throws JBIException
context
- the component's context, providing access to component data provided
by the JBI environment; must be non-null.
JBIException
- if the component is unable to initialize.void shutDown() throws JBIException
init(ComponentContext)
must be called before the component can be started again with a call to start()
.
JBIException
- if the component is unable to shut down.void start() throws JBIException
init(ComponentContext)
, both when the component is being
started for the first time and when the component is being restarted after a previous
call to shutDown()
. If stop()
was called previously but shutDown()
was not, start()
can be called again without another call to
init(ComponentContext)
.
JBIException
- if the component is unable to start.void stop() throws JBIException
start()
may be called again without first
calling init(ComponentContext)
.
JBIException
- if the component is unable to stop.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |