|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jwarp.service.ServiceFactory
Class implementing a context's service factory.
| Field Summary | |
static int |
STATUS_FACTORY_CREATED
Run status |
static int |
STATUS_FACTORY_READY
|
static int |
STATUS_FACTORY_RUNNING
|
| Constructor Summary | |
ServiceFactory(IContext context)
Creates a new service factory |
|
| Method Summary | |
IService |
addService(org.jdom.Element config)
Add dynamically a new service. |
void |
addService(IService service,
java.lang.String name)
Add dynamically a new service. |
protected void |
assureSecurityObjects(java.lang.String[][] secObjects)
|
void |
configure(org.jdom.Element servicesRoot)
Start the service with the given root configuration |
java.lang.String[][] |
getSecurityObjects()
Returns the system object entities defined by this system instance. |
IService |
getService(java.lang.String serviceName)
Return the service with the given name |
java.util.Iterator |
getServices()
Returns all services. |
protected IService |
initService(java.lang.String implClass,
java.lang.String name,
org.jdom.Element config)
Initialize a service. |
void |
removeService(java.lang.String serviceName)
Remove dynamically a new service. |
void |
resumeService(java.lang.String serviceName,
ITicket ticket)
Resume a suspended service with the given root configuration |
void |
shutdownService(java.lang.String serviceName,
ITicket ticket)
Shut down a service with the given root configuration |
protected void |
shutdownServices(ITicket ticket)
Shutdown all services |
void |
start(ITicket systemTicket)
Initialize the factory's status, init the systemTicket and try to start all services. |
void |
startService(java.lang.String serviceName,
ITicket ticket)
Start a service with the given root configuration |
protected void |
startServices(ITicket ticket)
Start the services found in the given configuration |
void |
stop(ITicket ticket)
Tries to start the configured services. |
void |
suspendService(java.lang.String serviceName,
ITicket ticket)
Suspend a service with the given root configuration |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int STATUS_FACTORY_CREATED
public static final int STATUS_FACTORY_READY
public static final int STATUS_FACTORY_RUNNING
| Constructor Detail |
public ServiceFactory(IContext context)
| Method Detail |
public java.lang.String[][] getSecurityObjects()
getSecurityObjects in interface IServiceFactory
public void start(ITicket systemTicket)
throws ServiceInitializationException,
ServiceRuntimeException
start in interface IServiceFactorysystemTicket - The system ticket.ServiceInitializationException - thrown when starting of a subprocess failed.
public void stop(ITicket ticket)
throws ServiceRuntimeException,
java.lang.SecurityException
IServiceFactorystop in interface IServiceFactoryorg.jwarp.service.IServiceFactoryServiceInitializationException - One or more services are initialized well.
Well initialize services should all be started.protected void startServices(ITicket ticket)
configuration - the configuration containing other service configurations
protected void shutdownServices(ITicket ticket)
throws ServiceRuntimeException,
java.lang.SecurityException
The - user
public void startService(java.lang.String serviceName,
ITicket ticket)
throws ServiceInitializationException,
ServiceNotFoundException
startService in interface IServiceFactoryserviceRoot - the configuration root for this service
public void shutdownService(java.lang.String serviceName,
ITicket ticket)
throws ServiceRuntimeException,
ServiceNotFoundException
shutdownService in interface IServiceFactoryserviceRoot - the configuration root for this service
public void resumeService(java.lang.String serviceName,
ITicket ticket)
throws ServiceRuntimeException,
ServiceNotFoundException
resumeService in interface IServiceFactoryserviceRoot - the configuration root for this service
public void suspendService(java.lang.String serviceName,
ITicket ticket)
throws ServiceRuntimeException,
ServiceNotFoundException
suspendService in interface IServiceFactoryserviceRoot - the configuration root for this service
public void configure(org.jdom.Element servicesRoot)
throws ConfigurationException
configure in interface IServiceFactoryserviceRoot - the configuration root for this servicepublic IService addService(org.jdom.Element config)
addService in interface IServiceFactoryconfig - The XML config subtree for the service
protected IService initService(java.lang.String implClass,
java.lang.String name,
org.jdom.Element config)
throws ConfigurationException
setContext and configure are called.serviceClass - Full qualified service class name.name - The name under which the service should initialisedconfig - The configuration subtree for the service
protected void assureSecurityObjects(java.lang.String[][] secObjects)
throws java.lang.SecurityException
public IService getService(java.lang.String serviceName)
throws java.lang.SecurityException
getService in interface IServiceFactoryserviceName - The name of the service to returnpublic java.util.Iterator getServices()
getServices in interface IServiceFactory
public void addService(IService service,
java.lang.String name)
throws java.lang.SecurityException
addService in interface IServiceFactoryservice - The new serviceserviceName - The service name under which the service should registeredticket - The system user who must WRITE access to the factoryjava.lang.SecurityException - If access was denied or a service with
the same name is running yet
public void removeService(java.lang.String serviceName)
throws java.lang.SecurityException,
ServiceNotFoundException
removeService in interface IServiceFactoryservice - The new serviceserviceName - The service name under which the service should registeredticket - The system user who must WRITE access to the factoryjava.lang.SecurityException - If access was denied or a service with
the same name is running yet
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||