intarsys runtime library

de.intarsys.tools.component
Class CommonStartStop

java.lang.Object
  extended by de.intarsys.tools.component.CommonStartStop
All Implemented Interfaces:
IInstantiable, IStartStop

public abstract class CommonStartStop
extends Object
implements IStartStop

A common implementation of IStartStop. This abstract class ensures that start and stop procedures are executed only once.


Constructor Summary
CommonStartStop()
           
 
Method Summary
 boolean isStarted()
          Answer true if this object is started
 boolean isStopped()
          Answer true if this object is stopped
 void start()
          Start the component lifecycle.
 void stop()
          Stop the component lifecycle.
 boolean stopRequested(Set visited)
          Ask the component if it agrees to end its lifecycle at the very moment.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonStartStop

public CommonStartStop()
Method Detail

isStarted

public final boolean isStarted()
Description copied from interface: IStartStop
Answer true if this object is started

Specified by:
isStarted in interface IStartStop
Returns:
Answer true if this object is started.

isStopped

public final boolean isStopped()
Description copied from interface: IStartStop
Answer true if this object is stopped

Specified by:
isStopped in interface IStartStop
Returns:
Answer true if this object is stopped.

start

public final void start()
Description copied from interface: IStartStop
Start the component lifecycle. A RuntimeException is expected when starting the component fails.

Specified by:
start in interface IStartStop

stop

public final void stop()
Description copied from interface: IStartStop
Stop the component lifecycle. All resources should be freed. A RuntimeException is expected when stopping the component fails.

Specified by:
stop in interface IStartStop

stopRequested

public boolean stopRequested(Set visited)
Description copied from interface: IStartStop
Ask the component if it agrees to end its lifecycle at the very moment. The component may deny this request, but it must be prepared anyway to be stopped.

Specified by:
stopRequested in interface IStartStop
Parameters:
visited - The optional set of already visited objects in the stop request cycle.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.