Top Description Inners Fields Constructors Methods
org.eclipse.jetty.util.component

public abstract Class AbstractLifeCycle

extends Object
implements LifeCycle
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.LifeCycle
Known Direct Subclasses
org.eclipse.jetty.util.component.ContainerLifeCycle, org.eclipse.jetty.util.component.StopLifeCycle, org.eclipse.jetty.util.preventers.AbstractLeakPreventer, org.eclipse.jetty.util.resource.ResourceFactoryInternals.LifeCycle, org.eclipse.jetty.util.thread.ReservedThreadExecutor, org.eclipse.jetty.util.thread.ScheduledExecutorScheduler, org.eclipse.jetty.util.thread.Sweeper, org.eclipse.jetty.util.thread.TimerScheduler
Annotations
@ManagedObject:Abstract Implementation of LifeCycle
Imports
java.util.Collection, .EventListener, .List, java.util.concurrent.CopyOnWriteArrayList, org.eclipse.jetty.util.TypeUtil, .Uptime, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.thread.AutoLock, org.slf4j.Logger, .LoggerFactory

Basic implementation of the life cycle interface for components.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
AbstractLifeCycle.AbstractLifeCycleListener

Deprecated this class is redundant now that LifeCycle.Listener has default methods.
pack-priv static enum
public class
AbstractLifeCycle.StopException

An exception, which if thrown by doStart will immediately stop the component

Field Summary

Modifier and TypeField and Description
private final List<EventListener>
private final AutoLock
private volatile AbstractLifeCycle.State
public static final String
private static final Logger
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
doStart()

Method to override to start the lifecycle

protected void
doStop()

Method to override to stop the lifecycle

public List<EventListener>
public String
public static String
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public void
private void
private void
private void
private void
private void
public final void
start()

Implements org.eclipse.jetty.util.component.LifeCycle.start.

Starts the component.

public final void
stop()

Implements org.eclipse.jetty.util.component.LifeCycle.stop.

Stops the component.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_eventListenerback to summary
private final List<EventListener> _eventListener
_lockback to summary
private final AutoLock _lock
_stateback to summary
private volatile AbstractLifeCycle.State _state
FAILEDback to summary
public static final String FAILED
LOGback to summary
private static final Logger LOG
STARTEDback to summary
public static final String STARTED
STARTINGback to summary
public static final String STARTING
STOPPEDback to summary
public static final String STOPPED
STOPPINGback to summary
public static final String STOPPING

Constructor Detail

AbstractLifeCycleback to summary
public AbstractLifeCycle()

Method Detail

addEventListenerback to summary
public boolean addEventListener(EventListener listener)

Implements org.eclipse.jetty.util.component.LifeCycle.addEventListener.

Annotations
@Override
doStartback to summary
protected void doStart() throws Exception

Method to override to start the lifecycle

Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
StopException:
If thrown, the lifecycle will immediately be stopped.
doStopback to summary
protected void doStop() throws Exception

Method to override to stop the lifecycle

Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
getEventListenersback to summary
public List<EventListener> getEventListeners()
getStateback to summary
public String getState()
Annotations
@ManagedAttribute:Lifecycle State for this instance
readonly:true
getStateback to summary
public static String getState(LifeCycle lc)
isFailedback to summary
public boolean isFailed()

Implements org.eclipse.jetty.util.component.LifeCycle.isFailed.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isFailed.

true if the component has failed to start or has failed to stop.

Annotations
@Override
isRunningback to summary
public boolean isRunning()

Implements org.eclipse.jetty.util.component.LifeCycle.isRunning.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isRunning.

true if the component is starting or has been started.

Annotations
@Override
isStartedback to summary
public boolean isStarted()

Implements org.eclipse.jetty.util.component.LifeCycle.isStarted.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isStarted.

true if the component has been started.

Annotations
@Override
isStartingback to summary
public boolean isStarting()

Implements org.eclipse.jetty.util.component.LifeCycle.isStarting.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isStarting.

true if the component is starting.

Annotations
@Override
isStoppedback to summary
public boolean isStopped()

Implements org.eclipse.jetty.util.component.LifeCycle.isStopped.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isStopped.

true if the component has been stopped.

Annotations
@Override
isStoppingback to summary
public boolean isStopping()

Implements org.eclipse.jetty.util.component.LifeCycle.isStopping.

Returns:boolean

Doc from org.eclipse.jetty.util.component.LifeCycle.isStopping.

true if the component is stopping.

Annotations
@Override
removeEventListenerback to summary
public boolean removeEventListener(EventListener listener)

Implements org.eclipse.jetty.util.component.LifeCycle.removeEventListener.

Annotations
@Override
setEventListenersback to summary
public void setEventListeners(Collection<EventListener> eventListeners)
setFailedback to summary
private void setFailed(Throwable th)
setStartedback to summary
private void setStarted()
setStartingback to summary
private void setStarting()
setStoppedback to summary
private void setStopped()
setStoppingback to summary
private void setStopping()
startback to summary
public final void start() throws Exception

Implements org.eclipse.jetty.util.component.LifeCycle.start.

Doc from org.eclipse.jetty.util.component.LifeCycle.start.

Starts the component.

Annotations
@Override
Exceptions
Exception:
If the component fails to start
stopback to summary
public final void stop() throws Exception

Implements org.eclipse.jetty.util.component.LifeCycle.stop.

Doc from org.eclipse.jetty.util.component.LifeCycle.stop.

Stops the component. The component may wait for current activities to complete normally, but it can be interrupted.

Annotations
@Override
Exceptions
Exception:
If the component fails to stop
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.util.component back to summary

public abstract Class AbstractLifeCycle.AbstractLifeCycleListener

extends Object
implements Listener
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
All Implemented Interfaces
org.eclipse.jetty.util.component.LifeCycle.Listener, java.util.EventListener
Annotations
@Deprecated

Deprecated

this class is redundant now that LifeCycle.Listener has default methods.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractLifeCycleListenerback to summary
public AbstractLifeCycleListener()

Method Detail

lifeCycleFailureback to summary
public void lifeCycleFailure(LifeCycle event, Throwable cause)

Overrides default org.eclipse.jetty.util.component.LifeCycle.Listener.lifeCycleFailure.

Annotations
@Override
lifeCycleStartedback to summary
public void lifeCycleStarted(LifeCycle event)

Overrides default org.eclipse.jetty.util.component.LifeCycle.Listener.lifeCycleStarted.

Annotations
@Override
lifeCycleStartingback to summary
public void lifeCycleStarting(LifeCycle event)

Overrides default org.eclipse.jetty.util.component.LifeCycle.Listener.lifeCycleStarting.

Annotations
@Override
lifeCycleStoppedback to summary
public void lifeCycleStopped(LifeCycle event)

Overrides default org.eclipse.jetty.util.component.LifeCycle.Listener.lifeCycleStopped.

Annotations
@Override
lifeCycleStoppingback to summary
public void lifeCycleStopping(LifeCycle event)

Overrides default org.eclipse.jetty.util.component.LifeCycle.Listener.lifeCycleStopping.

Annotations
@Override
org.eclipse.jetty.util.component back to summary

pack-priv final Enum AbstractLifeCycle.State

extends Enum<AbstractLifeCycle.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AbstractLifeCycle.State
public static final AbstractLifeCycle.State
public static final AbstractLifeCycle.State
public static final AbstractLifeCycle.State
public static final AbstractLifeCycle.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AbstractLifeCycle.State
public static AbstractLifeCycle.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FAILEDback to summary
public static final AbstractLifeCycle.State FAILED
STARTEDback to summary
public static final AbstractLifeCycle.State STARTED
STARTINGback to summary
public static final AbstractLifeCycle.State STARTING
STOPPEDback to summary
public static final AbstractLifeCycle.State STOPPED
STOPPINGback to summary
public static final AbstractLifeCycle.State STOPPING

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static AbstractLifeCycle.State valueOf(String name)
valuesback to summary
public static AbstractLifeCycle.State[] values()
org.eclipse.jetty.util.component back to summary

public Class AbstractLifeCycle.StopException

extends RuntimeException
Class Inheritance

An exception, which if thrown by doStart will immediately stop the component

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

StopExceptionback to summary
public StopException()