org.jwarp.service.configuration
Class ConfigurationService

java.lang.Object
  |
  +--org.jwarp.service.AService
        |
        +--org.jwarp.service.configuration.ConfigurationService
All Implemented Interfaces:
IConfigurable, IConfigurationService, IExceptionProvider, IReferenceable, IService

public class ConfigurationService
extends AService
implements IConfigurationService

Service for handling configurations.

Version:
1.0
Author:
ORCA Systems GmbH, Martin Schäfer

Fields inherited from class org.jwarp.service.AService
context, createdDate, dependencies, emptyProperties, exceptionListeners, log, resumedDate, serviceName, serviceStatus, serviceType, startedDate, stoppedDate, suspendedDate, systemTicket
 
Fields inherited from interface org.jwarp.service.configuration.IConfigurationService
SERVICE_TYPE
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
Constructor Summary
ConfigurationService()
          Creates a new configuration service
 
Method Summary
 IConfiguration addConfiguration(java.lang.String url, ITicket user)
          Tries to add a new configuration specified by the configuration url.
 void configure(org.jdom.Element configuration)
          This configures the service.
 IConfiguration getConfiguration(java.lang.String configurationName, ITicket user)
          Return the configuration with the given name
 IConfiguration removeConfiguration(java.lang.String name, ITicket user)
          Tries to remove the configuration with the given name
 void shutdown(ITicket ticket)
          Shut down the service.
 
Methods inherited from class org.jwarp.service.AService
addExceptionListener, checkContext, createLogFromXML, getContext, getCreationDate, getDependencies, getExceptionListeners, getLog, getLogLevel, getName, getReference, getResumedDate, getShutDownDate, getStartDate, getStatus, getSuspendedDate, getType, removeAllExceptionListeners, removeExceptionListener, resume, sendExceptionEvent, setContext, setDependencies, setLogLevel, setName, start, suspend
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jwarp.service.IService
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, start, suspend
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Constructor Detail

ConfigurationService

public ConfigurationService()
Creates a new configuration service
Method Detail

getConfiguration

public IConfiguration getConfiguration(java.lang.String configurationName,
                                       ITicket user)
                                throws java.lang.SecurityException,
                                       NotFoundException
Return the configuration with the given name
Specified by:
getConfiguration in interface IConfigurationService
Parameters:
configurationName - The name of the configuration
user - The user's ticket

addConfiguration

public IConfiguration addConfiguration(java.lang.String url,
                                       ITicket user)
                                throws java.lang.SecurityException,
                                       NotFoundException
Tries to add a new configuration specified by the configuration url.
Specified by:
addConfiguration in interface IConfigurationService
Parameters:
name - The url of the configuration
user - The user's ticket
Throws:
java.lang.SecurityException - If the access was denied
NotFoundException - If the url could not be resolved or read.

removeConfiguration

public IConfiguration removeConfiguration(java.lang.String name,
                                          ITicket user)
                                   throws java.lang.SecurityException,
                                          NotFoundException
Tries to remove the configuration with the given name
Specified by:
removeConfiguration in interface IConfigurationService
Parameters:
name - The name of the configuration
user - The user's ticket
Throws:
java.lang.SecurityException - If the access was denied
NotFoundException - If the configuration could not be located.

configure

public void configure(org.jdom.Element configuration)
               throws ConfigurationException
This configures the service. The service can be configured and then started independently.
Specified by:
configure in interface IConfigurable
Overrides:
configure in class AService
Parameters:
configuration - the configuration root for this service
Throws:
ServiceConfigurationException - If the configuration is missing or invalid

shutdown

public void shutdown(ITicket ticket)
              throws ServiceRuntimeException,
                     java.lang.SecurityException
Shut down the service. This overrides the implementation by clearing all configurations from the internal table.
Specified by:
shutdown in interface IService
Overrides:
shutdown in class AService
Following copied from interface: org.jwarp.service.IService
Parameters:
ticket - The user ticket
Throws:
ServiceRuntimeException - If the service could not be shut own
java.lang.SecurityException - If access was denied.

©   O R C A   S y s t e m s