org.ow2.petals.kernel.configuration
Class ConfigurationServiceImpl

java.lang.Object
  extended by org.ow2.petals.kernel.configuration.ConfigurationServiceImpl
All Implemented Interfaces:
ConfigurationService

public class ConfigurationServiceImpl
extends java.lang.Object
implements ConfigurationService

Class implementing the ConfigurationService interface.
FIXME : Create an implementation for distributed mode and one for standalone mode. This will avoid some if then tests.

Since:
Petals 2.0
Author:
Roland NAUDIN, chamerling - EBMWebsourcing, Charles Casadei - eBM WebSourcing

Field Summary
protected  org.ow2.petals.util.LoggingUtil log
          Logging utilities
 
Fields inherited from interface org.ow2.petals.kernel.configuration.ConfigurationService
JAAS_PROPS_FILE, MASTER, PEER, PROPERTY_AUTOLOADER, PROPERTY_CLASSLOADER_ISOLATED, PROPERTY_CONTAINER_NAME, PROPERTY_EXCHANGE_VALIDATION, PROPERTY_PERSISTENCE_DURATION, PROPERTY_PERSISTENCE_FETCHSIZE, PROPERTY_RECOVERY_CORE_POOL_SIZE, PROPERTY_RECOVERY_KEEP_ALIVE_TIME, PROPERTY_RECOVERY_MAX_POOL_SIZE, PROPERTY_REGISTRY_DB_DIALECT, PROPERTY_REGISTRY_DB_DRIVER, PROPERTY_REGISTRY_DB_PASSWORD, PROPERTY_REGISTRY_DB_URL, PROPERTY_REGISTRY_DB_USER, PROPERTY_REGISTRY_MODE, PROPERTY_REGISTRY_REPOSITORY, PROPERTY_REGISTRY_SYNCHRO_PERIOD, PROPERTY_REGISTRY_TRANSPORT_TIMEOUT, PROPERTY_REPOSITORY_PATH, PROPERTY_ROUTER_QOS, PROPERTY_ROUTER_SEND_ATTEMPT, PROPERTY_ROUTER_SEND_DELAY, PROPERTY_ROUTER_STRATEGY, PROPERTY_SSL_KEY_PASSWORD, PROPERTY_SSL_KEYSTORE_FILE, PROPERTY_SSL_KEYSTORE_PASSWORD, PROPERTY_SSL_TRUSTSTORE_FILE, PROPERTY_SSL_TRUSTSTORE_PASSWORD, PROPERTY_TASK_TIMEOUT, PROPERTY_TOPOLOGY_UPDATE_PERIOD, PROPERTY_TOPOLOGY_URL, PROPERTY_TRANSPORT_TCP_CONNECTION_TIMEOUT, PROPERTY_TRANSPORT_TCP_RECEIVERS, PROPERTY_TRANSPORT_TCP_SEND_EVICTABLE_DELAY, PROPERTY_TRANSPORT_TCP_SEND_EVICTOR_DELAY, PROPERTY_TRANSPORT_TCP_SEND_TIMEOUT, PROPERTY_TRANSPORT_TCP_SENDERS, PROPERTY_USER_CONFIG_PREFIX, SERVER_PROPS_FILE, SLAVE, STANDALONE, TOPOLOGY_FILE, TOPOLOGY_RESOURCE
 
Constructor Summary
ConfigurationServiceImpl()
           
 
Method Summary
 void addContainerConfiguration(ContainerConfiguration addedContainer)
          Registers a new container configuration within the local configuration.
 void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
          Registers a new subdomain within the local topology.
 void backupTopology()
          Backups the local topology.
 ContainerConfiguration getContainerConfiguration()
          Get the local container configuration.
 ContainerConfiguration getContainerConfiguration(java.lang.String containerName)
          Get the container configuration.
 java.util.Set<ContainerConfiguration> getContainersConfiguration()
          Get the containers configuration.
 DomainConfiguration getDomainConfiguration()
          Get the domain configuration the local container belongs to.
 SubDomainConfiguration getSubDomainConfiguration()
          Get the sub domain configuration the local container belongs to.
 java.util.Set<SubDomainConfiguration> getSubDomainsConfiguration()
          Get the subdomains configuration.
 org.ow2.petals.topology.generated.Topology getTopology()
          Get the current topology.
 void loadTopology()
          Load or reload the topology.
 void removeContainerConfiguration(ContainerConfiguration removedContainer)
          Unregisters the subdomain within the local topology.
 void removeSubdomainConfiguration(java.lang.String removedSubdomainName)
          Unregister a subdomain within the local topology.
 void setContainerState(ContainerConfiguration.ContainerState state)
          Set the running state of the local container.
protected  void start()
           
protected  void stop()
           
 void validateDynamicTopology()
          Validate the dynamic topology
 void verifyContainerTopology(ContainerConfiguration newContainerConfiguration, SubDomainConfiguration newSubDomainConfiguration, DomainConfiguration newDomainConfiguration)
          Verify the given containerConfiguration against the topology configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.ow2.petals.util.LoggingUtil log
Logging utilities

Constructor Detail

ConfigurationServiceImpl

public ConfigurationServiceImpl()
Method Detail

addContainerConfiguration

public void addContainerConfiguration(ContainerConfiguration addedContainer)
                               throws ConfigurationException
Registers a new container configuration within the local configuration.

Specified by:
addContainerConfiguration in interface ConfigurationService
Parameters:
addedContainer - the container to be registered
Throws:
ConfigurationException

addSubdomainConfiguration

public void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
                               throws ConfigurationException
Registers a new subdomain within the local topology.

Specified by:
addSubdomainConfiguration in interface ConfigurationService
Throws:
ConfigurationException

backupTopology

public void backupTopology()
                    throws ConfigurationException
Backups the local topology.

Specified by:
backupTopology in interface ConfigurationService
Throws:
ConfigurationException

getContainerConfiguration

public ContainerConfiguration getContainerConfiguration()
Description copied from interface: ConfigurationService
Get the local container configuration.

Specified by:
getContainerConfiguration in interface ConfigurationService

getContainerConfiguration

public ContainerConfiguration getContainerConfiguration(java.lang.String containerName)
Get the container configuration.

Specified by:
getContainerConfiguration in interface ConfigurationService
Parameters:
containerName - the name of the container to get configuration from. If null, returns the local container configuration.
Returns:

getContainersConfiguration

public java.util.Set<ContainerConfiguration> getContainersConfiguration()
Get the containers configuration. This only returns the container configuration created at startup from local persisted data.

Specified by:
getContainersConfiguration in interface ConfigurationService
Returns:

getDomainConfiguration

public DomainConfiguration getDomainConfiguration()
Get the domain configuration the local container belongs to.

Specified by:
getDomainConfiguration in interface ConfigurationService
Returns:

getSubDomainConfiguration

public SubDomainConfiguration getSubDomainConfiguration()
Get the sub domain configuration the local container belongs to.

Specified by:
getSubDomainConfiguration in interface ConfigurationService
Returns:

getSubDomainsConfiguration

public java.util.Set<SubDomainConfiguration> getSubDomainsConfiguration()
Get the subdomains configuration. This only returns the subdomain configuration created at startup from the local persisted data.

Specified by:
getSubDomainsConfiguration in interface ConfigurationService
Returns:

getTopology

public org.ow2.petals.topology.generated.Topology getTopology()
                                                       throws ConfigurationException
Get the current topology. This is the topology loaded from configuration files.

Specified by:
getTopology in interface ConfigurationService
Returns:
Throws:
ConfigurationException

loadTopology

public void loadTopology()
                  throws ConfigurationException
Load or reload the topology.

Specified by:
loadTopology in interface ConfigurationService
Throws:
ConfigurationException

removeContainerConfiguration

public void removeContainerConfiguration(ContainerConfiguration removedContainer)
                                  throws ConfigurationException
Description copied from interface: ConfigurationService
Unregisters the subdomain within the local topology.

Specified by:
removeContainerConfiguration in interface ConfigurationService
Throws:
ConfigurationException

removeSubdomainConfiguration

public void removeSubdomainConfiguration(java.lang.String removedSubdomainName)
                                  throws ConfigurationException
Description copied from interface: ConfigurationService
Unregister a subdomain within the local topology.

Specified by:
removeSubdomainConfiguration in interface ConfigurationService
Throws:
ConfigurationException

setContainerState

public void setContainerState(ContainerConfiguration.ContainerState state)
Set the running state of the local container.

Specified by:
setContainerState in interface ConfigurationService
Parameters:
state - ContainerConfiguration.ContainerState

validateDynamicTopology

public void validateDynamicTopology()
                             throws ConfigurationException
Description copied from interface: ConfigurationService
Validate the dynamic topology

Specified by:
validateDynamicTopology in interface ConfigurationService
Throws:
ConfigurationException

verifyContainerTopology

public void verifyContainerTopology(ContainerConfiguration newContainerConfiguration,
                                    SubDomainConfiguration newSubDomainConfiguration,
                                    DomainConfiguration newDomainConfiguration)
                             throws org.ow2.petals.topology.TopologyException
Description copied from interface: ConfigurationService
Verify the given containerConfiguration against the topology configuration.

Specified by:
verifyContainerTopology in interface ConfigurationService
Parameters:
newContainerConfiguration - The new container configuration
newSubDomainConfiguration - The new sub-domain configuration
newDomainConfiguration - The new domain configuration
Throws:
org.ow2.petals.topology.TopologyException - Inconsistency between the topology configuration and the new container configuration

start

protected void start()
              throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
LifeCycleController.startFc()

stop

protected void stop()
             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.