org.apache.xbean.kernel
Interface ServiceCondition

All Known Implementing Classes:
RunningServiceCondition, StoppedServiceCondition

public interface ServiceCondition

A ServiceContion represents a prerequsite for a service to start or stop. A condition can be added to a service with the ServiceFactory.addStartCondition(ServiceCondition) or ServiceFactory.addStopCondition(ServiceCondition) methods.

Since:
2.0
Version:
$Id$
Author:
Dain Sundstrom

Method Summary
 void destroy()
          Destroys the condition.
 void initialize(ServiceConditionContext context)
          Initializes the condition.
 boolean isSatisfied()
          Gets statisfied state of this conditon.
 

Method Detail

initialize

public void initialize(ServiceConditionContext context)
Initializes the condition. The conition is now allowed reserve unique resources and start threads. mehtod should never block the thread nor should it throw any exceptions.

Note: this method is called from within a critical lock within the kernel, so do not block the thread or call back into the kernel. This method should never throw an exception.

Parameters:
context - context information for this condition

isSatisfied

public boolean isSatisfied()
Gets statisfied state of this conditon. Once a condition returns true from this method it is assumed to be satisfied until destroyed and reinitialized.

Note: this method is called from within a critical lock within the kernel, so do not block the thread or call back into the kernel. This method should never throw an exception.

Returns:
true if this condition is satisfied; false otherwise

destroy

public void destroy()
Destroys the condition. The condition must release all resources and stop any started threads.

Note: this method is called from within a critical lock within the kernel, so do not block the thread or call back into the kernel. This method should never throw an exception.



Copyright © {inceptionYear}-2006 Apache Software Foundation. All Rights Reserved.