org.apache.excalibur.instrument.manager.http.server
Class AbstractLogEnabledInstrumentableStartable

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
          extended by org.apache.excalibur.instrument.manager.http.server.AbstractLogEnabledInstrumentableStartable
All Implemented Interfaces:
java.lang.Runnable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.logger.LogEnabled, org.apache.excalibur.instrument.Instrumentable
Direct Known Subclasses:
AbstractSocketServer

abstract class AbstractLogEnabledInstrumentableStartable
extends org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
implements org.apache.avalon.framework.activity.Startable, java.lang.Runnable

Version:
$Revision: 1.4 $
Author:
Avalon Development Team

Field Summary
private  java.lang.Thread m_runner
          Reference to the worker thread.
private  boolean m_runnerStop
          Flag set when the m_runner thread has been asked to stop.
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
AbstractLogEnabledInstrumentableStartable()
          Creates a new AbstractLogEnabledInstrumentableStartable.
 
Method Summary
 boolean isStopping()
          Returns true when the component is in the process of being stopped.
 void run()
          Run method which is responsible for launching the runner method and handling the shutdown cycle.
protected abstract  void runner()
          Runner method that will be called when the component is started.
 void start()
          Starts the runner thread.
 void stop()
          Stops the runner thread, blocking until it has stopped.
protected  void stopRunner()
          Called when the component is being stopped, the isStopping method will always return true when this method is called.
 
Methods inherited from class org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_runner

private java.lang.Thread m_runner
Reference to the worker thread.


m_runnerStop

private boolean m_runnerStop
Flag set when the m_runner thread has been asked to stop.

Constructor Detail

AbstractLogEnabledInstrumentableStartable

public AbstractLogEnabledInstrumentableStartable()
Creates a new AbstractLogEnabledInstrumentableStartable.

Method Detail

start

public void start()
           throws java.lang.Exception
Starts the runner thread.

Specified by:
start in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception - If there are any problems.

stop

public void stop()
          throws java.lang.Exception
Stops the runner thread, blocking until it has stopped.

Specified by:
stop in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception - If there are any problems stopping the component.

run

public void run()
Run method which is responsible for launching the runner method and handling the shutdown cycle.

Specified by:
run in interface java.lang.Runnable

stopRunner

protected void stopRunner()
                   throws java.lang.Exception
Called when the component is being stopped, the isStopping method will always return true when this method is called. This version of the method does nothing.

Throws:
java.lang.Exception - If there are any problems

runner

protected abstract void runner()
Runner method that will be called when the component is started. The method must monitor the isStopping() method and make sure that it returns in a timely manner when the isStopping() method returns true.


isStopping

public boolean isStopping()
Returns true when the component is in the process of being stopped.

Returns:
True when the component is in the process of being stopped.