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,AbstractEventDriver,AbstractExtension,AbstractLeakPreventer,AbstractWebAppProvider,AcceptRateLimit,AllowedResourceAliasChecker,BaseHolder,CompressionPool,ConnectionLimit,ConnectionStatistics,ConnectorServer,ConnectorStatistics,ContainerLifeCycle,DebugListener,HouseKeeper,JsrSessionTracker,LeakDetector,MemcachedSessionDataMap,PathWatcher,PropertyUserStoreManager,RequestLogWriter,ReservedThreadExecutor,Scanner,ScanningAppProvider,ScheduledExecutorScheduler,ServletContainerInitializersStarter,ServletContextHandler.Initializer,SessionTracker,Slf4jRequestLogWriter,SpnegoLoginService,SslContextFactory,StopLifeCycle,Sweeper,TimerScheduler,UserStore
@ManagedObject("Abstract Implementation of LifeCycle") public abstract class AbstractLifeCycle extends java.lang.Object implements LifeCycle
Basic implementation of the life cycle interface for components.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractLifeCycle.AbstractLifeCycleListenerDeprecated.this class is redundant now thatLifeCycle.Listenerhas default methods.-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description AbstractLifeCycle()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLifeCycleListener(LifeCycle.Listener listener)protected voiddoStart()protected voiddoStop()java.lang.StringgetState()static java.lang.StringgetState(LifeCycle lc)longgetStopTimeout()booleanisFailed()booleanisRunning()booleanisStarted()booleanisStarting()booleanisStopped()booleanisStopping()voidremoveLifeCycleListener(LifeCycle.Listener listener)voidsetStopTimeout(long stopTimeout)voidstart()Starts the component.voidstop()Stops the component.java.lang.StringtoString()
-
-
-
Field Detail
-
STOPPED
public static final java.lang.String STOPPED
- See Also:
- Constant Field Values
-
FAILED
public static final java.lang.String FAILED
- See Also:
- Constant Field Values
-
STARTING
public static final java.lang.String STARTING
- See Also:
- Constant Field Values
-
STARTED
public static final java.lang.String STARTED
- See Also:
- Constant Field Values
-
STOPPING
public static final java.lang.String STOPPING
- See Also:
- Constant Field Values
-
RUNNING
public static final java.lang.String RUNNING
- See Also:
- Constant Field Values
-
-
Method Detail
-
doStart
protected void doStart() throws java.lang.Exception- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception- Throws:
java.lang.Exception
-
start
public final void start() throws java.lang.ExceptionDescription copied from interface:LifeCycleStarts the component.- Specified by:
startin interfaceLifeCycle- Throws:
java.lang.Exception- If the component fails to start- See Also:
LifeCycle.isStarted(),LifeCycle.stop(),LifeCycle.isFailed()
-
stop
public final void stop() throws java.lang.ExceptionDescription copied from interface:LifeCycleStops the component. The component may wait for current activities to complete normally, but it can be interrupted.- Specified by:
stopin interfaceLifeCycle- Throws:
java.lang.Exception- If the component fails to stop- See Also:
LifeCycle.isStopped(),LifeCycle.start(),LifeCycle.isFailed()
-
isRunning
public boolean isRunning()
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceLifeCycle- Returns:
- true if the component has been started.
- See Also:
LifeCycle.start(),LifeCycle.isStarting()
-
isStarting
public boolean isStarting()
- Specified by:
isStartingin interfaceLifeCycle- Returns:
- true if the component is starting.
- See Also:
LifeCycle.isStarted()
-
isStopping
public boolean isStopping()
- Specified by:
isStoppingin interfaceLifeCycle- Returns:
- true if the component is stopping.
- See Also:
LifeCycle.isStopped()
-
isStopped
public boolean isStopped()
- Specified by:
isStoppedin interfaceLifeCycle- Returns:
- true if the component has been stopped.
- See Also:
LifeCycle.stop(),LifeCycle.isStopping()
-
isFailed
public boolean isFailed()
-
addLifeCycleListener
public void addLifeCycleListener(LifeCycle.Listener listener)
- Specified by:
addLifeCycleListenerin interfaceLifeCycle
-
removeLifeCycleListener
public void removeLifeCycleListener(LifeCycle.Listener listener)
- Specified by:
removeLifeCycleListenerin interfaceLifeCycle
-
getState
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public java.lang.String getState()
-
getState
public static java.lang.String getState(LifeCycle lc)
-
getStopTimeout
@ManagedAttribute("The stop timeout in milliseconds") public long getStopTimeout()
-
setStopTimeout
public void setStopTimeout(long stopTimeout)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-