Index Changes

JBI Component Configuration

Components installed in the OpenESB JBI runtime can be configured externally via the OpenESB clients: GlassFish Administration Console, asadmin CLI and ANT. An administrator can update a component's configuration after it is installed. There are three types of configuration for a component:

Configuration Type Description
1 Component configuration these are the component properties
Example component configuration for the HTTP BC is: OutboundThreads: Maximum number of threads to process outgoing HTTP/SOAP client invocations concurrently
2 Application Configuration application specific named configuration
3 Application Variables application specific variables

A component could require none, all or any of the above types of configuration. If a component does have any configuration to be managed it must:

  1. Register a JMX MBean for configuration management.
  2. Describe the components configuration in the components descriptor i.e. in the jbi.xml for the component.

Each of these steps is explained in detail below :

Register a JMX MBean for management of the configuration

JBI Components can register custom MBeans, i.e. non-JBI-specific, user-defined MBeans for management. The component configuration MBean is one such MBean. Though the MBean is a custom component MBean, its name ( the MBeanName with which the MBean is registered in the MBean Server ) should be obtained from the JBI runtime. This MBean has to be registered when the component is started.

The component can get the MBeanName for this MBean by calling javax.jbi.management.MBeanNames.createCustomComponentMBeanName("Configuration") in the ComponentLifeCycle.start() operation. Here is an example of a component registering its configuration MBean :

    /**
     * Start the Binding Component.
     * @throws javax.jbi.JBIException if an error occurs.
     */
    public void start()
        throws javax.jbi.JBIException
    {
        // mContext - Component Context
        try
        {
            ConfigurationMBean mbean = new Configuration();
            StandardMBean compMBean = new StandardMBean(mbean, 
                ConfigurationMBean.class);

            ObjectName compMBeanName = 
                mContext.getMBeanNames().createCustomComponentMBeanName("Configuration");

            mContext.getMBeanServer().registerMBean(compMBean, compMBeanName);
        }
        catch ( Exception exp )
        {
            throw new javax.jbi.JBIException(exp.getMessage());
        }
    }
Note: The custom name parameter passed into the createCustomComponentMBeanName() method must be "Configuration" for the component's Configuration MBean to be recognized by the OpenESB runtime.

The actual implementation of the component configuration MBean varies based on what level of configuration support is required by the component. Follow these links for Configuration MBean details:

Describe the component configuration in the component descriptor

The OpenESB runtime looks at the component descriptor (jbi.xml) to get information on the component's requirements for configuration. So it is critical that component developers describe meta-data for the component configuration in the jbi.xml for the component. In OpenESB we have defined a schema for providing the component configuration, the XSD schema document componentConfiguration.xsd is installed with OpenESB and can be found in the ${JBI_INSTALL_ROOT}/schemas folder.

As an example, the configuration for the HTTP Binding Component is defined as follows in its jbi.xml ( look at the config:Configuration element ) :


<?xml version="1.0"?>
<!-- jbi.xml descriptor for the HTTP SOAP binding component (BC) -->
<jbi
    version="1.0"
    xmlns="http://java.sun.com/xml/ns/jbi"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:config="http://www.sun.com/jbi/Configuration/V1.0"
    xmlns:identification="http://www.sun.com/jbi/descriptor/identification"
    xmlns:logging="http://www.sun.com/jbi/descriptor/logging">

    <!-- identification information about this binding -->
    <component type="binding-component" component-class-loader-delegation="self-first">
        <identification>
            <name>sun-http-binding</name>
            <description>HTTP binding component. Provides message processing capabilities over HTTP protocol in a JBI 1.0 compliant environment.</description>
            <identification:VersionInfo specification-version="1.0" build-number="080328"/>
        </identification>
        <component-class-name description="Component Class name" >com.sun.jbi.httpsoapbc.HttpSoapBindingComponent</component-class-name>
        <component-class-path>
            <path-element>httpsoapbcimpl.jar</path-element>
            <path-element>wsdl4j.jar</path-element>
            <path-element>resolver.jar</path-element>
            <path-element>componentsl.jar</path-element>
            <path-element>net.sf.hulp.meas.itf.jar</path-element>
            <path-element>net.sf.hulp.meas.impl.jar</path-element>
            <path-element>common-util.jar</path-element>
            <path-element>qos.jar</path-element>
        </component-class-path>
        <bootstrap-class-name>com.sun.jbi.httpsoapbc.bootstrap.HttpSoapBindingBootstrap</bootstrap-class-name>
        <bootstrap-class-path>
            <path-element>httpsoapbcimpl.jar</path-element>
            <path-element>componentsl.jar</path-element>
            <path-element>qos.jar</path-element>    
            <path-element>common-util.jar</path-element>
        </bootstrap-class-path>
        <logging:Logging root="com.sun.jbi.httpsoapbc">
            <logging:logger displayName="HTTP Extensions">com.sun.jbi.httpsoapbc.Extension</logging:logger>
        </logging:Logging> 
       <!-- Define the component configuration --> 
       <config:Configuration>
           <!-- Component properties -->
           <config:Property name="OutboundThreads" 
                            type="xsd:int" 
                            displayName="Number of Outbound Threads" 
                            displayDescription="Maximum number of threads to process outgoing HTTP/SOAP client invocations concurrently. Any integer number between 1 and 2147483647 is allowed." 
                            defaultValue="100" 
                            showDisplay="all">
               <config:Constraint facet="minInclusive" value="5"/> 
               <config:Constraint facet="maxInclusive" value="2147483647"/>     
           </config:Property>
           <config:Property name="HttpDefaultPort" 
                            type="xsd:int" 
                            displayName="Default HTTP Port Number" 
                            displayDescription="Default HTTP port number for incoming HTTP/SOAP requests. The default value is -1 which indicates there is no valid port number defined. A valid port number is any positive integer between 1 and 65535, but it is highly recommended to avoid system reserved ports." 
                            defaultValue="-1" 
                            showDisplay="all"
                            isApplicationRestartRequired="true">
               <config:Constraint facet="minInclusive" value="-1"/> 
               <config:Constraint facet="maxInclusive" value="65536"/> 
           </config:Property>
           <config:Property name="HttpsDefaultPort" 
                            type="xsd:int" 
                            displayName="Default HTTPS Port Number" 
                            displayDescription="Default HTTPS port number for incoming HTTP/SOAP requests. The default value is -1 which indicates there is no valid port number defined. A valid port number is any positive integer between 1 and 65535, but it is highly recommended to avoid system reserved ports."        
                            defaultValue="-1" 
                            showDisplay="all"
                            isApplicationRestartRequired="true">
               <config:Constraint facet="minInclusive" value="-1"/> 
               <config:Constraint facet="maxInclusive" value="65536"/> 
           </config:Property>
           <config:Property name="AMConfigDirectory" 
                            type="xsd:string" 
                            displayName="Sun Access Manager Configuration Directory" 
                            displayDescription="Sun Access Manager configuration directory containing the AM configuration properties file"  
                            showDisplay="all"/>
           <config:Property name="ProxyType" 
                            type="xsd:string" 
                            displayName="Proxy Type" 
                            displayDescription="A valid proxy type. Allowed proxy type values are: SOCKS, HTTP, and DIRECT. This configuration is used for outgoing HTTP/SOAP client invocations only." 
                            defaultValue="SOCKS" 
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true">
               <config:Constraint facet="enumeration" value="SOCKS"/>
               <config:Constraint facet="enumeration" value="HTTP"/>
               <config:Constraint facet="enumeration" value="DIRECT"/>
           </config:Property>
           <config:Property name="ProxyHost" 
                            type="xsd:string" 
                            displayName="Proxy Host" 
                            displayDescription="A valid proxy host name. This configuration is used for outgoing HTTP/SOAP client invocations only." 
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true"/>
           <config:Property name="ProxyPort" 
                            type="xsd:int" 
                            displayName="Proxy Port" 
                            displayDescription="A valid proxy port. This configuration is used for outgoing HTTP/SOAP client invocations only." 
                            defaultValue="-1"
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true">
               <config:Constraint facet="minInclusive" value="-1"/> 
               <config:Constraint facet="maxInclusive" value="65536"/> 
           </config:Property>
           <config:Property name="NonProxyHosts" 
                            type="xsd:string" 
                            displayName="Non-proxy Hosts" 
                            displayDescription="A list of server hosts whose connections do not require a proxy server" 
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true"/>
           <config:Property name="ProxyUserName" 
                            type="xsd:string" 
                            displayName="Proxy User Name" 
                            displayDescription="A valid proxy user name" 
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true"/>
           <config:Property name="ProxyPassword" 
                            type="xsd:string" 
                            displayName="Proxy User Password" 
                            displayDescription="A valid proxy user password" 
                            showDisplay="all"
                            encrypted="true" 
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true"/>
           <config:Property name="UseJVMProxySettings" 
                            type="xsd:boolean" 
                            defaultValue="true" 
                            displayName="Use Default JVM Proxy Settings" 
                            displayDescription="Determines whether or not to use the default JVM system properties for proxy settings" 
                            showDisplay="all"
                            isApplicationRestartRequired="true" 
                            isComponentRestartRequired="true"/>
          <!-- Application Configuration -->
          <!-- The config:ApplicationConfiguration defines the composite type for Application Configuration and also indicates that the
               component supports application configuration -->
          <config:ApplicationConfiguration>
              <config:Property name="configurationName" 
                               type="xsd:string" 
                               displayName="Application Configuration Name" 
                               displayDescription="Name of the application configuration" 
                               required="true"
                               isApplicationRestartRequired="true"/>
              <config:Property name="httpUrlLocation" 
                               type="xsd:string"
                               displayName="HTTP URL Location" 
                               displayDescription="Endpoint address - HTTP URL location"  
                               required="true"
                               isApplicationRestartRequired="true"/>
          </config:ApplicationConfiguration>
          <!-- Application Variable --> 
          <!-- The config:ApplicationVariable element indicates that the component supports application variables -->
          <config:ApplicationVariable isApplicationRestartRequired="true">
              <config:name/>
              <config:type/>
              <config:value/>
          </config:ApplicationVariable>
       </config:Configuration>
    </component>
</jbi>

The component configuration can be managed from the GlassFish Administration console. This is an example of what the configuration screen looks like for the HTTP Binding Component:

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-19) was last changed on 30-Sep-08 18:42 PM, -0700 by MarkWhite