Version 2

    Simplified Clustered Service Configuration

     

    Beginning with release 4.0.4.GA of JBoss AS, the configuration of services that depend on the ClusterPartition service has changed.  These services include:

     

    • HA-JNDI

    • DistributedState

    • HASessionState (state replication for EJB 2.1 SFSBs)

    • Farming

    • JGCacheInvalidationBridge (JGroups-based EJB 2.1 entity bean cache invalidation)

    • HASingletonDeployer (deploys the deploy-hasingleton folder)

    • User-defined subclasses of HAServiceMBeanSupport (which include subclasses of HASingletonSupport)

     

    Prior to 4.0.4.GA, configuration of these services included these elements:

     

       <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>    <!-- Name of the partition to which the service is linked -->    <attribute name="PartitionName">${jboss.partition.name:DefaultPartition}</attribute>

     

    The first element declared a dependency on the ClusterPartition service; the second provided the name of the partition.  This name was used to perform a lookup (in JNDI or JMX) of one of the ClusterPartition service's subservices, the HAPartition.

     

    This lookup is no longer necessary, as for several releases now JBoss has supported a form of dependency injection in its service configuration.  A proxy to the ClusterPartition can be injected into the dependent service, and the HAPartition retrieved directly from the proxy.  Using dependency injection, configuration can now be simplified to:

     

    <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends>

     

    Note that the old style of configuration is still supported to ease migration of existing service configurations.  If the ClusterPartition is not injected, services will attempt to do a lookup of the HAPartition using the value of the PartitionName attribute.