intarsys runtime library

de.intarsys.tools.event
Class LifecycleWatchdog

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

public abstract class LifecycleWatchdog
extends Object
implements IStartStop

A tool for intercepting and handling lifecycle related events.


Constructor Summary
LifecycleWatchdog(INotificationSupport factory)
           
 
Method Summary
 String getLabel()
           
 INotificationSupport getObject()
           
 boolean isStarted()
          Answer true if this object is started
 boolean isStopped()
          Answer true if this object is stopped
 void setLabel(String label)
           
 void start()
          Arm the watchdog itself.
 void startAuto()
          Arm the watchdog itself.
 void stop()
          Disarm the watchdog itself.
 boolean stopRequested(Set visited)
          Ask the component if it agrees to end its lifecycle at the very moment.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LifecycleWatchdog

public LifecycleWatchdog(INotificationSupport factory)
Method Detail

getLabel

public String getLabel()

getObject

public INotificationSupport getObject()

isStarted

public 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 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.

setLabel

public void setLabel(String label)

start

public void start()
Arm the watchdog itself. From now it will listen to the creation of new instances.

Specified by:
start in interface IStartStop
See Also:
IStartStop.start()

startAuto

public void startAuto()
Arm the watchdog itself. From now it will listen to the creation of new instances.

See Also:
IStartStop.start()

stop

public void stop()
Disarm the watchdog itself. From now it will not longer listen to the creation of new instances.

Specified by:
stop in interface IStartStop
See Also:
IStartStop.stop()

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.

toString

public String toString()
Overrides:
toString in class Object

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.