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

public Interface LifeCycle

Known Direct Subinterfaces
org.eclipse.jetty.util.resource.ResourceFactory.LifeCycle, org.eclipse.jetty.util.thread.Scheduler
Known Direct Implementers
org.eclipse.jetty.util.component.AbstractLifeCycle
Annotations
@ManagedObject:Lifecycle Interface for startable components
Imports
java.util.EventListener, org.eclipse.jetty.util.annotation.ManagedObject, .ManagedOperation

The lifecycle interface for generic components.
Classes implementing this interface have a defined life cycle defined by the methods of this interface.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean

Returns:

true if the component has failed to start or has failed to stop.
isFailed
()

public boolean

Returns:

true if the component is starting or has been started.
isRunning
()

public boolean

Returns:

true if the component has been started.
isStarted
()

public boolean

Returns:

true if the component is starting.
isStarting
()

public boolean

Returns:

true if the component has been stopped.
isStopped
()

public boolean

Returns:

true if the component is stopping.
isStopping
()

public boolean
public void
start()

Starts the component.

public static void
start(Object
The instance to start.
object
)

Utility to start an object if it is a LifeCycle and to convert any exception thrown to a RuntimeException

public void
stop()

Stops the component.

public static void
stop(Object
The instance to stop.
object
)

Utility to stop an object if it is a LifeCycle and to convert any exception thrown to a RuntimeException

Method Detail

addEventListenerback to summary
public boolean addEventListener(EventListener listener)
isFailedback to summary
public boolean isFailed()
Returns:boolean

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

isRunningback to summary
public boolean isRunning()
Returns:boolean

true if the component is starting or has been started.

isStartedback to summary
public boolean isStarted()
Returns:boolean

true if the component has been started.

See Also
start(), isStarting()
isStartingback to summary
public boolean isStarting()
Returns:boolean

true if the component is starting.

See Also
isStarted()
isStoppedback to summary
public boolean isStopped()
Returns:boolean

true if the component has been stopped.

See Also
stop(), isStopping()
isStoppingback to summary
public boolean isStopping()
Returns:boolean

true if the component is stopping.

See Also
isStopped()
removeEventListenerback to summary
public boolean removeEventListener(EventListener listener)
startback to summary
public void start() throws Exception

Starts the component.

Annotations
@ManagedOperation:Starts the instance
impact:ACTION
Exceptions
Exception:
If the component fails to start
See Also
isStarted(), stop(), isFailed()
startback to summary
public static void start(Object object)

Utility to start an object if it is a LifeCycle and to convert any exception thrown to a RuntimeException

Parameters
object:Object

The instance to start.

Exceptions
RuntimeException:
if the call to start throws an exception.
stopback to summary
public void stop() throws Exception

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

Annotations
@ManagedOperation:Stops the instance
impact:ACTION
Exceptions
Exception:
If the component fails to stop
See Also
isStopped(), start(), isFailed()
stopback to summary
public static void stop(Object object)

Utility to stop an object if it is a LifeCycle and to convert any exception thrown to a RuntimeException

Parameters
object:Object

The instance to stop.

Exceptions
RuntimeException:
if the call to stop throws an exception.
org.eclipse.jetty.util.component back to summary

public Interface LifeCycle.Listener

extends EventListener
Known Direct Implementers
org.eclipse.jetty.util.component.StopLifeCycle, org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.FileNoticeLifeCycleListener, org.eclipse.jetty.util.component.HaltLifeCycleListener

Listener. A listener for Lifecycle events.

Method Summary

Modifier and TypeMethod and Description
public default void
public default void
public default void
public default void
public default void

Method Detail

lifeCycleFailureback to summary
public default void lifeCycleFailure(LifeCycle event, Throwable cause)
lifeCycleStartedback to summary
public default void lifeCycleStarted(LifeCycle event)
lifeCycleStartingback to summary
public default void lifeCycleStarting(LifeCycle event)
lifeCycleStoppedback to summary
public default void lifeCycleStopped(LifeCycle event)
lifeCycleStoppingback to summary
public default void lifeCycleStopping(LifeCycle event)