|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServiceFactory
A service factory is responsible for construction and destruction of a single service. A service factory provides the kernel the start conditions, stopped conditions, owned services and enabled status of the service.
Method Summary | |
---|---|
void |
addStartCondition(ServiceCondition startCondition)
Adds start condition to this service. |
void |
addStopCondition(ServiceCondition stopCondition)
Adds stop condition to this service. |
Object |
createService(ServiceContext serviceContext)
Creates the service instance. |
void |
destroyService(ServiceContext serviceContext)
Destroys the service instance. |
ClassLoader |
getClassLoader()
Gets the class loader associated with this service. |
Set |
getOwnedServices()
Gets the names of services owned by 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. |
Class[] |
getTypes()
Gets the types of the service this service factory will create. |
boolean |
isEnabled()
Determines if the service can be instantiated in a kernel. |
boolean |
isRestartable()
A restartable service can be started and stopped repeatedly in the 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. |
Method Detail |
---|
Class[] getTypes()
boolean isRestartable()
boolean isEnabled()
void setEnabled(boolean enabled)
enabled
- the new enabled state of this factorySet getStartConditions()
void addStartCondition(ServiceCondition startCondition) throws NullPointerException
startCondition
- the new start condition
NullPointerException
- if startCondition is nullvoid removeStartCondition(ServiceCondition startCondition) throws NullPointerException
startCondition
- the start condition to remove
NullPointerException
- if startCondition is nullSet getStopConditions()
void addStopCondition(ServiceCondition stopCondition) throws NullPointerException
stopCondition
- the new stop condition
NullPointerException
- if stopCondition is nullvoid removeStopCondition(ServiceCondition stopCondition) throws NullPointerException
stopCondition
- the stop condition to remove
NullPointerException
- if stopCondition is nullSet getOwnedServices()
Object createService(ServiceContext serviceContext) throws Exception
serviceContext
- context information for the new service
Exception
- if a problem occurs during constructionvoid destroyService(ServiceContext serviceContext)
serviceContext
- the context information for the serviceClassLoader getClassLoader()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |