## org.eclipse.jetty.util.component
Class AbstractLifeCycle

    java.lang.Object
      org.eclipse.jetty.util.component.AbstractLifeCycle

All Implemented Interfaces:
  LifeCycle

Direct Known Subclasses:
  AbstractHandler, AbstractSessionIdManager, AbstractSessionManager, ConnectorServer, ContextDeployer, DeploymentManager, ExecutorThreadPool, Holder, HttpBuffers, JAASLoginService, MappedLoginService, MBeanContainer, NCSARequestLog, OldQueuedThreadPool, PropertyUserStore, QueuedThreadPool, ScanningAppProvider, SelectorManager, WebAppDeployer

    public abstract class AbstractLifeCycle

extends java.lang.Object
implements LifeCycle

Basic implementation of the life cycle interface for components.

Nested Class Summary
`static class` `AbstractLifeCycle.AbstractLifeCycleListener`

Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
`LifeCycle.Listener`

Field Summary
`protected LifeCycle.Listener[]` `_listeners`
`static java.lang.String` `FAILED`
`static java.lang.String` `RUNNING`
`static java.lang.String` `STARTED`
`static java.lang.String` `STARTING`
`static java.lang.String` `STOPPED`
`static java.lang.String` `STOPPING`

Constructor Summary
`AbstractLifeCycle()`

Method Summary
`void` `addLifeCycleListener(LifeCycle.Listener listener)`
`protected void` `doStart()`
`protected void` `doStop()`
`java.lang.String` `getState()`
`boolean` `isFailed()`
`boolean` `isRunning()`
`boolean` `isStarted()`
`boolean` `isStarting()`
`boolean` `isStopped()`
`boolean` `isStopping()`
`void` `removeLifeCycleListener(LifeCycle.Listener listener)`
`void` `start()` Starts the component.
`void` `stop()` Stops the component.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### _listeners

    protected LifeCycle.Listener[] _listeners

Constructor Detail

### AbstractLifeCycle

    public AbstractLifeCycle()

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.Exception

  Description copied from interface: `LifeCycle`
  Starts the component.

  Specified by:
    `start` in interface `LifeCycle`
  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.Exception

  Description copied from interface: `LifeCycle`
  Stops the component. The component may wait for current activities to complete normally, but it can be interrupted.

  Specified by:
    `stop` in interface `LifeCycle`
  Throws:
    `java.lang.Exception` - If the component fails to stop
  See Also:
    `LifeCycle.isStopped()`, `LifeCycle.start()`, `LifeCycle.isFailed()`

### isRunning

    public boolean isRunning()

  Specified by:
    `isRunning` in interface `LifeCycle`
  Returns:
    true if the component is starting or has been started.

### isStarted

    public boolean isStarted()

  Specified by:
    `isStarted` in interface `LifeCycle`
  Returns:
    true if the component has been started.
  See Also:
    `LifeCycle.start()`, `LifeCycle.isStarting()`

### isStarting

    public boolean isStarting()

  Specified by:
    `isStarting` in interface `LifeCycle`
  Returns:
    true if the component is starting.
  See Also:
    `LifeCycle.isStarted()`

### isStopping

    public boolean isStopping()

  Specified by:
    `isStopping` in interface `LifeCycle`
  Returns:
    true if the component is stopping.
  See Also:
    `LifeCycle.isStopped()`

### isStopped

    public boolean isStopped()

  Specified by:
    `isStopped` in interface `LifeCycle`
  Returns:
    true if the component has been stopped.
  See Also:
    `LifeCycle.stop()`, `LifeCycle.isStopping()`

### isFailed

    public boolean isFailed()

  Specified by:
    `isFailed` in interface `LifeCycle`
  Returns:
    true if the component has failed to start or has failed to stop.

### addLifeCycleListener

    public void addLifeCycleListener(LifeCycle.Listener listener)

  Specified by:
    `addLifeCycleListener` in interface `LifeCycle`

### removeLifeCycleListener

    public void removeLifeCycleListener(LifeCycle.Listener listener)

  Specified by:
    `removeLifeCycleListener` in interface `LifeCycle`

### getState

    public java.lang.String getState()

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.