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
,AcceptRateLimit
,BaseHolder
,CompressionPool
,ConnectionLimit
,ConnectionStatistics
,ConnectorServer
,ConnectorStatistics
,ContainerLifeCycle
,DebugListener
,HouseKeeper
,LeakDetector
,PathWatcher
,PropertyUserStoreManager
,RequestLogWriter
,ReservedThreadExecutor
,Scanner
,ScheduledExecutorScheduler
,ServletContextHandler.Initializer
,Slf4jRequestLogWriter
,SpnegoLoginService
,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 ClassesNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CopyOnWriteArrayList
<LifeCycle.Listener> private final Object
private int
private long
static final String
private static final Logger
static final String
static final String
static final String
private static final int
private static final int
private static final int
private static final int
private static final int
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLifeCycleListener
(LifeCycle.Listener listener) protected void
doStart()
protected void
doStop()
getState()
static String
long
boolean
isFailed()
boolean
boolean
boolean
boolean
boolean
void
removeLifeCycleListener
(LifeCycle.Listener listener) private void
private void
private void
private void
private void
void
setStopTimeout
(long stopTimeout) final void
start()
Starts the component.final void
stop()
Stops the component.toString()
-
Field Details
-
LOG
-
STOPPED
- See Also:
-
FAILED
- See Also:
-
STARTING
- See Also:
-
STARTED
- See Also:
-
STOPPING
- See Also:
-
RUNNING
- See Also:
-
_listeners
-
_lock
-
STATE_FAILED
private static final int STATE_FAILED- See Also:
-
STATE_STOPPED
private static final int STATE_STOPPED- See Also:
-
STATE_STARTING
private static final int STATE_STARTING- See Also:
-
STATE_STARTED
private static final int STATE_STARTED- See Also:
-
STATE_STOPPING
private static final int STATE_STOPPING- See Also:
-
_state
private volatile int _state -
_stopTimeout
private long _stopTimeout
-
-
Constructor Details
-
AbstractLifeCycle
public AbstractLifeCycle()
-
-
Method Details
-
doStart
- Throws:
Exception
-
doStop
- Throws:
Exception
-
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() -
addLifeCycleListener
- Specified by:
addLifeCycleListener
in interfaceLifeCycle
-
removeLifeCycleListener
- Specified by:
removeLifeCycleListener
in interfaceLifeCycle
-
getState
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public String getState() -
getState
-
setStarted
private void setStarted() -
setStarting
private void setStarting() -
setStopping
private void setStopping() -
setStopped
private void setStopped() -
setFailed
-
getStopTimeout
-
setStopTimeout
public void setStopTimeout(long stopTimeout) -
toString
-