public interface Lifecycle
Modifier and Type | Field and Description |
---|---|
static String |
AFTER_START_EVENT
The LifecycleEvent type for the "component after start" event.
|
static String |
AFTER_STOP_EVENT
The LifecycleEvent type for the "component after stop" event.
|
static String |
BEFORE_START_EVENT
The LifecycleEvent type for the "component before start" event.
|
static String |
BEFORE_STOP_EVENT
The LifecycleEvent type for the "component before stop" event.
|
static String |
INIT_EVENT
The LifecycleEvent type for the "component init" event.
|
static String |
START_EVENT
The LifecycleEvent type for the "component start" event.
|
static String |
STOP_EVENT
The LifecycleEvent type for the "component stop" event.
|
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.
|
List<LifecycleListener> |
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated
with this Lifecycle instance.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.
|
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
static final String INIT_EVENT
static final String START_EVENT
static final String BEFORE_START_EVENT
static final String AFTER_START_EVENT
static final String STOP_EVENT
static final String BEFORE_STOP_EVENT
static final String AFTER_STOP_EVENT
void addLifecycleListener(LifecycleListener listener)
listener
- The listener to addList<LifecycleListener> findLifecycleListeners()
void removeLifecycleListener(LifecycleListener listener)
listener
- The listener to removevoid start() throws LifecycleException
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedvoid stop() throws LifecycleException
LifecycleException
- if this component detects a fatal error
that needs to be reportedCopyright © 2021. All rights reserved.