org.rhq.core.pc.configuration
Class ConfigurationManager

java.lang.Object
  extended by org.rhq.core.pc.agent.AgentService
      extended by org.rhq.core.pc.configuration.ConfigurationManager
All Implemented Interfaces:
ConfigurationAgentService, ContainerService

public class ConfigurationManager
extends AgentService
implements ContainerService, ConfigurationAgentService

Manages configuration of all resources across all plugins.

This is an agent service; its interface is made remotely accessible if this is deployed within the agent.

Author:
Jason Dobies

Nested Class Summary
 
Nested classes/interfaces inherited from class org.rhq.core.pc.agent.AgentService
AgentService.LifecycleState
 
Constructor Summary
ConfigurationManager()
           
 
Method Summary
 ConfigurationUpdateResponse executeUpdateResourceConfigurationImmediately(ConfigurationUpdateRequest request)
           
protected  ConfigurationFacet getConfigurationFacet(int resourceId, FacetLockType lockType)
          Given a resource ID, this obtains that resource's ConfigurationFacet interface.
protected  ConfigurationServerService getConfigurationServerService()
          If this manager can talk to a server-side ConfigurationServerService, a proxy to that service is returned.
protected  org.rhq.core.domain.resource.ResourceType getResourceType(int resourceId)
          Given a resource ID, this obtains that resource's type.
protected  ExecutorService getThreadPool()
          Returns a thread pool that this object will use when asychronously executing configuration operations on a component.
 void initialize()
          Initializes the container service which will effectively tell the service to start doing its work.
 org.rhq.core.domain.configuration.Configuration loadResourceConfiguration(int resourceId)
           
 org.rhq.core.domain.configuration.Configuration merge(org.rhq.core.domain.configuration.Configuration configuration, int resourceId, boolean fromStructured)
           
 void setComponentService(ComponentService componentService)
           
 void setConfigManagementFactory(ConfigManagementFactory factory)
           
 void setConfiguration(PluginContainerConfiguration configuration)
          Informs the container service how it should be configured by providing the full plugin container configuration.
 void shutdown()
          Stops the container service which effectively releases all runtime resources such as running threads.
 void updateResourceConfiguration(ConfigurationUpdateRequest request)
           
 org.rhq.core.domain.configuration.Configuration validate(org.rhq.core.domain.configuration.Configuration configuration, int resourceId, boolean isStructured)
           
 
Methods inherited from class org.rhq.core.pc.agent.AgentService
addLifecycleListener, getClientInterface, notifyLifecycleListenersOfNewState, remoteInputStream, remoteOutputStream, removeLifecycleListener, setAgentServiceStreamRemoter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationManager

public ConfigurationManager()
Method Detail

initialize

public void initialize()
Description copied from interface: ContainerService
Initializes the container service which will effectively tell the service to start doing its work. Implementations of this interface can be assured that prior to this method being called, a non-null configuration will be set via a call to ContainerService.setConfiguration(PluginContainerConfiguration).

Specified by:
initialize in interface ContainerService

shutdown

public void shutdown()
Description copied from interface: ContainerService
Stops the container service which effectively releases all runtime resources such as running threads.

Specified by:
shutdown in interface ContainerService

setConfiguration

public void setConfiguration(PluginContainerConfiguration configuration)
Description copied from interface: ContainerService
Informs the container service how it should be configured by providing the full plugin container configuration. The plugin container will ensure it passes in a non-null configuration object so implementations of this interface should never have to worry about a null configuration parameter value.

Specified by:
setConfiguration in interface ContainerService

setComponentService

public void setComponentService(ComponentService componentService)

setConfigManagementFactory

public void setConfigManagementFactory(ConfigManagementFactory factory)

updateResourceConfiguration

public void updateResourceConfiguration(ConfigurationUpdateRequest request)
Specified by:
updateResourceConfiguration in interface ConfigurationAgentService

executeUpdateResourceConfigurationImmediately

public ConfigurationUpdateResponse executeUpdateResourceConfigurationImmediately(ConfigurationUpdateRequest request)
                                                                          throws PluginContainerException
Specified by:
executeUpdateResourceConfigurationImmediately in interface ConfigurationAgentService
Throws:
PluginContainerException

merge

public org.rhq.core.domain.configuration.Configuration merge(org.rhq.core.domain.configuration.Configuration configuration,
                                                             int resourceId,
                                                             boolean fromStructured)
                                                      throws PluginContainerException
Specified by:
merge in interface ConfigurationAgentService
Throws:
PluginContainerException

loadResourceConfiguration

public org.rhq.core.domain.configuration.Configuration loadResourceConfiguration(int resourceId)
                                                                          throws PluginContainerException
Specified by:
loadResourceConfiguration in interface ConfigurationAgentService
Throws:
PluginContainerException

getThreadPool

protected ExecutorService getThreadPool()
Returns a thread pool that this object will use when asychronously executing configuration operations on a component.

Returns:
a thread pool this object will use

getConfigurationFacet

protected ConfigurationFacet getConfigurationFacet(int resourceId,
                                                   FacetLockType lockType)
                                            throws PluginContainerException
Given a resource ID, this obtains that resource's ConfigurationFacet interface. If it does not support the configuration facet, an exception is thrown.

Parameters:
resourceId - identifies the resource whose facet is to be returned
lockType - how access to the facet is synchronized
Returns:
the resource's configuration facet component
Throws:
PluginContainerException - on error

getResourceType

protected org.rhq.core.domain.resource.ResourceType getResourceType(int resourceId)
                                                             throws PluginContainerException
Given a resource ID, this obtains that resource's type.

Parameters:
resourceId - identifies the resource whose type is to be returned
Returns:
the resource's type, if known
Throws:
PluginContainerException - if cannot determine the resource's type

getConfigurationServerService

protected ConfigurationServerService getConfigurationServerService()
If this manager can talk to a server-side ConfigurationServerService, a proxy to that service is returned.

Returns:
the server-side proxy; null if this manager doesn't have a server to talk to

validate

public org.rhq.core.domain.configuration.Configuration validate(org.rhq.core.domain.configuration.Configuration configuration,
                                                                int resourceId,
                                                                boolean isStructured)
                                                         throws PluginContainerException
Specified by:
validate in interface ConfigurationAgentService
Throws:
PluginContainerException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.