org.apache.xbean.kernel
Class AbstractServiceFactory

java.lang.Object
  extended by org.apache.xbean.kernel.AbstractServiceFactory
All Implemented Interfaces:
ServiceFactory
Direct Known Subclasses:
StaticServiceFactory

public abstract class AbstractServiceFactory
extends Object
implements ServiceFactory

AbstractServiceFactory is an implementation of ServiceFactory that handles all of the mundane issues.

Since:
2.0
Author:
Dain Sundstrom

Constructor Summary
AbstractServiceFactory()
           
 
Method Summary
 void addStartCondition(ServiceCondition startCondition)
          Adds start condition to this service.
 void addStopCondition(ServiceCondition stopCondition)
          Adds stop condition to this service.
 Set getStartConditions()
          Get an unmodifable snapshot of the conditions that must be satisfied before this service can be started.
 Set getStopConditions()
          Get an unmodifable snapshot of the conditions that must be satisfied before this service can be stopped.
 boolean isEnabled()
          Determines if the service can be instantiated in a kernel.
 void removeStartCondition(ServiceCondition startCondition)
          Removes a start condition from this service.
 void removeStopCondition(ServiceCondition stopCondition)
          Removes a stop condition from this service.
 void setEnabled(boolean enabled)
          Sets the enabled status of this service factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xbean.kernel.ServiceFactory
createService, destroyService, getClassLoader, getOwnedServices, getTypes, isRestartable
 

Constructor Detail

AbstractServiceFactory

public AbstractServiceFactory()
Method Detail

isEnabled

public boolean isEnabled()
Determines if the service can be instantiated in a kernel. A disabled restartable service can not be started and a disabled non-restartable service can not be loaded into a kernel.

Specified by:
isEnabled in interface ServiceFactory
Returns:
true if the service factory is enabled; false otherwise

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled status of this service factory. A disabled restartable service can not be started and a disabled non-restartable service can not be loaded into a kernel.

Specified by:
setEnabled in interface ServiceFactory
Parameters:
enabled - the new enabled state of this factory

getStartConditions

public Set getStartConditions()
Get an unmodifable snapshot of the conditions that must be satisfied before this service can be started.

Specified by:
getStartConditions in interface ServiceFactory
Returns:
the start conditions of this service

addStartCondition

public void addStartCondition(ServiceCondition startCondition)
                       throws NullPointerException
Adds start condition to this service.

Specified by:
addStartCondition in interface ServiceFactory
Parameters:
startCondition - the new start condition
Throws:
NullPointerException - if startCondition is null

removeStartCondition

public void removeStartCondition(ServiceCondition startCondition)
                          throws NullPointerException
Removes a start condition from this service.

Specified by:
removeStartCondition in interface ServiceFactory
Parameters:
startCondition - the start condition to remove
Throws:
NullPointerException - if startCondition is null

getStopConditions

public Set getStopConditions()
Get an unmodifable snapshot of the conditions that must be satisfied before this service can be stopped.

Specified by:
getStopConditions in interface ServiceFactory
Returns:
the stop conditions of this service

addStopCondition

public void addStopCondition(ServiceCondition stopCondition)
                      throws NullPointerException
Adds stop condition to this service.

Specified by:
addStopCondition in interface ServiceFactory
Parameters:
stopCondition - the new stop condition
Throws:
NullPointerException - if stopCondition is null

removeStopCondition

public void removeStopCondition(ServiceCondition stopCondition)
                         throws NullPointerException
Removes a stop condition from this service.

Specified by:
removeStopCondition in interface ServiceFactory
Parameters:
stopCondition - the stop condition to remove
Throws:
NullPointerException - if stopCondition is null


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