[jboss-cvs] JBossAS SVN: r65330 - in trunk/cluster: src/etc and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 12 08:54:13 EDT 2007


Author: jerrygauth
Date: 2007-09-12 08:54:13 -0400 (Wed, 12 Sep 2007)
New Revision: 65330

Modified:
   trunk/cluster/.classpath
   trunk/cluster/src/etc/deploy-hasingleton-beans.xml
   trunk/cluster/src/main/org/jboss/ha/jmx/HAServiceMBeanSupport.java
Log:
JBAS-4543, Make HAServiceMBeanSupport "bean name aware"

Modified: trunk/cluster/.classpath
===================================================================
--- trunk/cluster/.classpath	2007-09-12 12:23:42 UTC (rev 65329)
+++ trunk/cluster/.classpath	2007-09-12 12:54:13 UTC (rev 65330)
@@ -23,6 +23,7 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-kernel.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-kernel-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/main"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>

Modified: trunk/cluster/src/etc/deploy-hasingleton-beans.xml
===================================================================
--- trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2007-09-12 12:23:42 UTC (rev 65329)
+++ trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2007-09-12 12:54:13 UTC (rev 65330)
@@ -34,9 +34,6 @@
       
       <depends>HAPartition</depends>
       
-      <!-- uncomment the following when JBossMC-2.0.0.Beta4 is available -->
-      <!--<property name="serviceHAName"><inject fromContext="name"/></property>-->
-      
       <property name="HAPartition"><inject bean="HAPartition"/></property>
       <property name="target"><inject bean="HASingletonDeploymentScanner"/></property>
       <property name="targetStartMethod">deploySingletons</property>

Modified: trunk/cluster/src/main/org/jboss/ha/jmx/HAServiceMBeanSupport.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/jmx/HAServiceMBeanSupport.java	2007-09-12 12:23:42 UTC (rev 65329)
+++ trunk/cluster/src/main/org/jboss/ha/jmx/HAServiceMBeanSupport.java	2007-09-12 12:54:13 UTC (rev 65330)
@@ -28,6 +28,8 @@
 import javax.management.Notification;
 import javax.management.ObjectName;
 
+import org.jboss.beans.metadata.plugins.annotations.FromContext;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
 import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
 import org.jboss.ha.framework.interfaces.DistributedState;
 import org.jboss.ha.framework.interfaces.HAPartition;
@@ -449,7 +451,7 @@
     * @return partition wide unique service name
     */
    public String getServiceHAName()
-   {
+   {         
       if (serviceHAName == null)
       {
          ObjectName on = getServiceName();
@@ -459,9 +461,8 @@
          }
          else
          {
-            // TODO JBAS-4543; note that this is dependent on JBMICROCONT-192 which
-            // will be available in JBossMC-2.0.0.Beta4.
-            // See comments in deploy-hasingleton-beans.xml for further details.
+            // This shouldn't occur as the service name is now injected by the microcontainer.
+            //  If injection fails, the service name should then be used.
             throw new IllegalStateException("Cannot determine ServiceHAName; " +
                     "either set it explicitly or register this object in JMX " +
                     "before calling create");
@@ -470,6 +471,7 @@
       return serviceHAName;
    }
    
+   @Inject(fromContext = FromContext.NAME)
    public void setServiceHAName(String haName)
    {
       this.serviceHAName = haName;




More information about the jboss-cvs-commits mailing list