org.apache.xbean.kernel.standard
Class StandardServiceConditionContext

java.lang.Object
  extended by org.apache.xbean.kernel.standard.StandardServiceConditionContext
All Implemented Interfaces:
ServiceConditionContext

public class StandardServiceConditionContext
extends Object
implements ServiceConditionContext

This is the service context used by the service manager.

Since:
2.0
Author:
Dain Sundstrom

Constructor Summary
StandardServiceConditionContext(Kernel kernel, ServiceName serviceName, ClassLoader classLoader, Lock lock, Condition condition)
          Creates a service context for the specified service.
 
Method Summary
 ClassLoader getClassLoader()
          Gets the class loader for the service.
 Kernel getKernel()
          Gets the kernel in which the service is registered.
 ServiceName getServiceName()
          Gets the unique name of the service.
 boolean isSatisfied()
          Gets the satisfied status of this condition.
 void setSatisfied()
          Used to notify the container that the condition has been satisfied asychronously.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardServiceConditionContext

public StandardServiceConditionContext(Kernel kernel,
                                       ServiceName serviceName,
                                       ClassLoader classLoader,
                                       Lock lock,
                                       Condition condition)
Creates a service context for the specified service.

Parameters:
kernel - the kernel in which the service is registered
serviceName - the name of the service
classLoader - the class loader for the service
lock - the lock for the service manager
condition - the condition that should be notified when the setSatisfied() method is called
Method Detail

getKernel

public Kernel getKernel()
Gets the kernel in which the service is registered.

Specified by:
getKernel in interface ServiceConditionContext
Returns:
the kernel in which the service is registered

getServiceName

public ServiceName getServiceName()
Gets the unique name of the service.

Specified by:
getServiceName in interface ServiceConditionContext
Returns:
the unique name of the service

getClassLoader

public ClassLoader getClassLoader()
Gets the class loader for the service.

Specified by:
getClassLoader in interface ServiceConditionContext
Returns:
the class loader for the service

isSatisfied

public boolean isSatisfied()
Gets the satisfied status of this condition. Once satisfied a condition is considered satisfied until destroyed and reinitialized. The ServiceManager uses the StandardServiceConditionContext to track the status of conditions so it will call setSatisfied() when the condition returns true from isSatisfied().

Returns:
satisfied status of this condition

setSatisfied

public void setSatisfied()
Used to notify the container that the condition has been satisfied asychronously.

Specified by:
setSatisfied in interface ServiceConditionContext


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.