## org.eclipse.jetty.util.component
Interface LifeCycle

All Known Subinterfaces:
  AppProvider, Connector, Handler, HandlerContainer, RequestLog, Server.Graceful, SessionIdManager, SessionManager, SslConnector

All Known Implementing Classes:
  AbstractConnector, AbstractHandler, AbstractHandlerContainer, AbstractLifeCycle, AbstractNIOConnector, AbstractSessionIdManager, AbstractSessionManager, Ajp13SocketConnector, BlockingChannelConnector, ConnectHandler, ConnectorServer, ConstraintSecurityHandler, ContextDeployer, ContextHandler, ContextHandlerCollection, ContextProvider, DataSourceLoginService, DebugHandler, DefaultHandler, DeploymentManager, ErrorHandler, ErrorPageErrorHandler, ExecutorThreadPool, FilterHolder, HandlerCollection, HandlerList, HandlerWrapper, HashLoginService, HashSessionIdManager, HashSessionManager, Holder, HotSwapHandler, HttpBuffers, HttpClient, InheritedChannelConnector, IPAccessHandler, JAASLoginService, JDBCLoginService, JDBCSessionIdManager, JDBCSessionManager, LocalConnector, MappedLoginService, MBeanContainer, MovedContextHandler, NCSARequestLog, OldQueuedThreadPool, PropertyUserStore, ProxyHandler, QueuedThreadPool, RequestLogHandler, ResourceHandler, RewriteHandler, ScanningAppProvider, ScopedHandler, SecurityHandler, SelectChannelConnector, SelectorManager, Server, ServletContextHandler, ServletHandler, ServletHandler, ServletHolder, SessionHandler, SocketConnector, SslSelectChannelConnector, SslSocketConnector, StatisticsHandler, WebAppContext, WebAppDeployer, WebAppProvider, WebSocketHandler

    public interface LifeCycle

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

Nested Class Summary
`static interface` `LifeCycle.Listener` Listener.

Method Summary
`void` `addLifeCycleListener(LifeCycle.Listener listener)`
`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.

Method Detail

### start

    void start()
               throws java.lang.Exception

  Starts the component.

  Throws:
    `java.lang.Exception` - If the component fails to start
  See Also:
    `isStarted()`, `stop()`, `isFailed()`

### stop

    void stop()
              throws java.lang.Exception

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

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

### isRunning

    boolean isRunning()

  Returns:
    true if the component is starting or has been started.

### isStarted

    boolean isStarted()

  Returns:
    true if the component has been started.
  See Also:
    `start()`, `isStarting()`

### isStarting

    boolean isStarting()

  Returns:
    true if the component is starting.
  See Also:
    `isStarted()`

### isStopping

    boolean isStopping()

  Returns:
    true if the component is stopping.
  See Also:
    `isStopped()`

### isStopped

    boolean isStopped()

  Returns:
    true if the component has been stopped.
  See Also:
    `stop()`, `isStopping()`

### isFailed

    boolean isFailed()

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

### addLifeCycleListener

    void addLifeCycleListener(LifeCycle.Listener listener)

### removeLifeCycleListener

    void removeLifeCycleListener(LifeCycle.Listener listener)

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