org.jboss.system
Class ServiceConfigurator

java.lang.Object
  extended by org.jboss.system.ServiceConfigurator

public class ServiceConfigurator
extends Object

Service configuration helper.

Version:
$Revision: 1.32.4.7 $
Author:
Marc Fleury, Hiram Chirino, David Jencks, Jason Dillon, Dimitris Andreadis

Constructor Summary
ServiceConfigurator(javax.management.MBeanServer server, ServiceController serviceController, ServiceCreator serviceCreator)
          Constructor
 
Method Summary
protected  void configure(javax.management.ObjectName objectName, javax.management.ObjectName loaderName, Element mbeanElement, List mbeans)
          The configure method configures an mbean based on the xml element configuration passed in.
 String getConfiguration(javax.management.ObjectName[] objectNames)
          Builds a string that consists of the configuration elements of the currently running MBeans registered in the server.
 List install(Element config, javax.management.ObjectName loaderName)
          The install method iterates through the mbean tags in the supplied xml configuration and creates and configures the mbeans shown.
 void setServiceBinding(ServiceBinding serviceBinding)
          Dynamically plug-in a ServiceBinding policy to possibly override the configuration of a service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceConfigurator

public ServiceConfigurator(javax.management.MBeanServer server,
                           ServiceController serviceController,
                           ServiceCreator serviceCreator)
Constructor

Parameters:
server -
serviceController -
serviceCreator -
Method Detail

setServiceBinding

public void setServiceBinding(ServiceBinding serviceBinding)
Dynamically plug-in a ServiceBinding policy to possibly override the configuration of a service.

Parameters:
serviceBinding - policy

install

public List install(Element config,
                    javax.management.ObjectName loaderName)
             throws DeploymentException
The install method iterates through the mbean tags in the supplied xml configuration and creates and configures the mbeans shown. The mbean configuration can be nested.

Parameters:
config - the xml Element containing the configuration of the mbeans to create and configure.
Returns:
a List of ObjectNames of created mbeans.
Throws:
DeploymentException - if an error occurs

getConfiguration

public String getConfiguration(javax.management.ObjectName[] objectNames)
                        throws Exception
Builds a string that consists of the configuration elements of the currently running MBeans registered in the server.

Throws:
Exception - Failed to construct configuration.

configure

protected void configure(javax.management.ObjectName objectName,
                         javax.management.ObjectName loaderName,
                         Element mbeanElement,
                         List mbeans)
                  throws Exception
The configure method configures an mbean based on the xml element configuration passed in. Three formats are supported: <attribute name="(name)">(value)</attribute> <depends optional-attribute-name="(name)">(object name of mbean referenced)</depends> <depends-list optional-attribute-name="(name)"> [list of] </depends-list-element>(object name)</depends-list-element> </depends-list> The last two can include nested mbean configurations or ObjectNames. SIDE-EFFECT: adds all mbeans this one depends on to the ServiceContext structures.

Parameters:
mbeanElement - an Element value
Throws:
Exception - if an error occurs


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.