intarsys runtime library

de.intarsys.tools.component
Interface IStartStop

All Superinterfaces:
IInstantiable
All Known Implementing Classes:
CommonStartStop, LifecycleWatchdog

public interface IStartStop
extends IInstantiable

This describes the components ability to explicitly start or stop its lifecycle. This is an alternative and more detailed description than supported by IStartable and should be preferred.


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.
 

Method Detail

isStarted

boolean isStarted()
Answer true if this object is started

Returns:
Answer true if this object is started.

isStopped

boolean isStopped()
Answer true if this object is stopped

Returns:
Answer true if this object is stopped.

start

void start()
Start the component lifecycle. A RuntimeException is expected when starting the component fails.


stop

void stop()
Stop the component lifecycle. All resources should be freed. A RuntimeException is expected when stopping the component fails.


stopRequested

boolean stopRequested(Set visited)
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.

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.