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
Modifier and TypeClassDescriptionstatic class
Deprecated.class
An 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addEventListener
(EventListener listener) protected void
doStart()
Method to override to start the lifecycleprotected void
doStop()
Method to override to stop the lifecyclegetState()
static String
boolean
isFailed()
boolean
boolean
boolean
boolean
boolean
boolean
removeEventListener
(EventListener listener) void
setEventListeners
(Collection<EventListener> eventListeners) final void
start()
Starts the component.final void
stop()
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:LifeCycle
Starts the component. -
stop
Description copied from interface:LifeCycle
Stops 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:
isStarting
in interfaceLifeCycle
- Returns:
- true if the component is starting.
- See Also:
-
isStopping
public boolean isStopping()- Specified by:
isStopping
in interfaceLifeCycle
- Returns:
- true if the component is stopping.
- See Also:
-
isStopped
public boolean isStopped() -
isFailed
public boolean isFailed() -
getEventListeners
-
setEventListeners
-
addEventListener
- Specified by:
addEventListener
in interfaceLifeCycle
-
removeEventListener
- Specified by:
removeEventListener
in interfaceLifeCycle
-
getState
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public String getState() -
getState
-
toString
-
LifeCycle.Listener
has default methods.