org.mortbay.jetty.plus
Class AbstractService

java.lang.Object
  extended by org.mortbay.jetty.plus.AbstractService
All Implemented Interfaces:
Service, LifeCycle
Direct Known Subclasses:
AbstractDataSourceService, MailService, TMService

public abstract class AbstractService
extends java.lang.Object
implements Service


Field Summary
protected  java.lang.String _jndi
           
protected  java.lang.String _name
           
protected  boolean _started
           
 
Constructor Summary
AbstractService()
           
 
Method Summary
 java.lang.String getJNDI()
           
 java.lang.String getName()
           
 boolean isStarted()
           
 void setJNDI(java.lang.String registration)
           
 void setName(java.lang.String name)
           
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_jndi

protected java.lang.String _jndi

_name

protected java.lang.String _name

_started

protected boolean _started
Constructor Detail

AbstractService

public AbstractService()
Method Detail

setJNDI

public void setJNDI(java.lang.String registration)
Specified by:
setJNDI in interface Service

getJNDI

public java.lang.String getJNDI()
Specified by:
getJNDI in interface Service

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Service

getName

public java.lang.String getName()
Specified by:
getName in interface Service

start

public void start()
           throws java.lang.Exception
Description copied from interface: Service
Start the LifeCycle.

Specified by:
start in interface Service
Specified by:
start in interface LifeCycle
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.InterruptedException
Description copied from interface: Service
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface Service
Specified by:
stop in interface LifeCycle
Throws:
java.lang.InterruptedException - Stopping a lifecycle is rarely atomic and may be interrupted by another thread. If this happens InterruptedException is throw and the component will be in an indeterminant state and should probably be discarded.

isStarted

public boolean isStarted()
Specified by:
isStarted in interface Service
Specified by:
isStarted in interface LifeCycle
Returns:
True if the LifeCycle has been started.


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.