Package org.eclipse.jetty.util.component
Class AbstractLifeCycle
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
- All Implemented Interfaces:
LifeCycle
- Direct Known Subclasses:
AbstractLeakPreventer,CompressionPool,ContainerLifeCycle,LeakDetector,PathWatcher,ReservedThreadExecutor,Scanner,ScheduledExecutorScheduler,SslContextFactory,StopLifeCycle,Sweeper,TimerScheduler
@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.Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifeCycleListener(LifeCycle.Listener listener) protected voiddoStart()protected voiddoStop()getState()static StringlongbooleanisFailed()booleanbooleanbooleanbooleanbooleanvoidremoveLifeCycleListener(LifeCycle.Listener listener) voidsetStopTimeout(long stopTimeout) final voidstart()Starts the component.final voidstop()Stops the component.toString()
-
Field Details
-
STOPPED
- See Also:
-
FAILED
- See Also:
-
STARTING
- See Also:
-
STARTED
- See Also:
-
STOPPING
- See Also:
-
RUNNING
- See Also:
-
-
Constructor Details
-
AbstractLifeCycle
public AbstractLifeCycle()
-
-
Method Details
-
doStart
- Throws:
Exception
-
doStop
- Throws:
Exception
-
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() -
addLifeCycleListener
- Specified by:
addLifeCycleListenerin interfaceLifeCycle
-
removeLifeCycleListener
- Specified by:
removeLifeCycleListenerin interfaceLifeCycle
-
getState
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public String getState() -
getState
-
getStopTimeout
-
setStopTimeout
public void setStopTimeout(long stopTimeout) -
toString
-
LifeCycle.Listenerhas default methods.