Package de.intarsys.tools.component
Class CommonStartStop
java.lang.Object
de.intarsys.tools.component.CommonStartStop
- All Implemented Interfaces:
IInstantiable,IStartStop
A common implementation of
IStartStop. This abstract class
ensures that start and stop procedures are executed only once.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidStart the component lifecycle.protected voidStop the component lifecycle.final booleanAnswertrueif this object is startedfinal voidstart()Start the component lifecycle.final voidstop()Stop the component lifecycle.booleanstopRequested(Set visited) Ask the component if it agrees to end its lifecycle at the very moment.
-
Constructor Details
-
CommonStartStop
public CommonStartStop()
-
-
Method Details
-
basicStart
protected void basicStart()Start the component lifecycle. This method is called once at most. -
basicStop
protected void basicStop()Stop the component lifecycle. This method is called once at most. -
isStarted
public final boolean isStarted()Description copied from interface:IStartStopAnswertrueif this object is started- Specified by:
isStartedin interfaceIStartStop- Returns:
- Answer
trueif this object is started.
-
start
public final void start()Description copied from interface:IStartStopStart the component lifecycle. A RuntimeException is expected when starting the component fails.- Specified by:
startin interfaceIStartStop
-
stop
public final void stop()Description copied from interface:IStartStopStop the component lifecycle. All resources should be freed. A RuntimeException is expected when stopping the component fails.- Specified by:
stopin interfaceIStartStop
-
stopRequested
Description copied from interface:IStartStopAsk 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:
stopRequestedin interfaceIStartStop- Parameters:
visited- The optional set of already visited objects in the stop request cycle.
-