Package org.eclipse.jetty.util.component
Class AbstractLifeCycle
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
- All Implemented Interfaces:
LifeCycle
- Direct Known Subclasses:
AbstractContextProvider,AbstractLeakPreventer,AbstractWebAppProvider,AcceptRateLimit,AllowedResourceAliasChecker,BaseHolder,ConnectionLimit,ConnectionStatistics,ConnectorServer,ContainerLifeCycle,DebugListener,HouseKeeper,LeakDetector,MemcachedSessionDataMap,PathWatcher,PropertyUserStoreManager,QuicSessionContainer,RequestLogWriter,ReservedThreadExecutor,ScheduledExecutorScheduler,ServletContainerInitializersStarter,ServletContextHandler.Initializer,SessionTracker,SessionTracker,Slf4jRequestLogWriter,SslContextFactory,StopLifeCycle,Sweeper,TimerScheduler,UserStore
@ManagedObject("Abstract Implementation of LifeCycle")
public abstract class AbstractLifeCycle
extends Object
implements LifeCycle
Basic implementation of the life cycle interface for components.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.classAn exception, which if thrown by doStart will immediately stop the componentNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEventListener(EventListener listener) protected voiddoStart()Method to override to start the lifecycleprotected voiddoStop()Method to override to stop the lifecyclegetState()static StringbooleanisFailed()booleanbooleanbooleanbooleanbooleanbooleanremoveEventListener(EventListener listener) voidsetEventListeners(Collection<EventListener> eventListeners) final voidstart()Starts the component.final voidstop()Stops the component.toString()
-
Field Details
-
STOPPED
-
FAILED
-
STARTING
-
STARTED
-
STOPPING
-
-
Constructor Details
-
AbstractLifeCycle
public AbstractLifeCycle()
-
-
Method Details
-
doStart
Method to override to start the lifecycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Method to override to stop the lifecycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
start
Description copied from interface:LifeCycleStarts the component. -
stop
Description copied from interface:LifeCycleStops the component. The component may wait for current activities to complete normally, but it can be interrupted. -
isRunning
public boolean isRunning() -
isStarted
public boolean isStarted() -
isStarting
public boolean isStarting()- Specified by:
isStartingin interfaceLifeCycle- Returns:
- true if the component is starting.
- See Also:
-
isStopping
public boolean isStopping()- Specified by:
isStoppingin interfaceLifeCycle- Returns:
- true if the component is stopping.
- See Also:
-
isStopped
public boolean isStopped() -
isFailed
public boolean isFailed() -
getEventListeners
-
setEventListeners
-
addEventListener
- Specified by:
addEventListenerin interfaceLifeCycle
-
removeEventListener
- Specified by:
removeEventListenerin interfaceLifeCycle
-
getState
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public String getState() -
getState
-
toString
-
LifeCycle.Listenerhas default methods.