[jboss-cvs] JBossAS SVN: r58564 - in trunk/cluster/src/main/org/jboss/invocation: jrmp/server unified/server

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 18 06:26:23 EST 2006


Author: bstansberry at jboss.com
Date: 2006-11-18 06:26:20 -0500 (Sat, 18 Nov 2006)
New Revision: 58564

Modified:
   trunk/cluster/src/main/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java
   trunk/cluster/src/main/org/jboss/invocation/unified/server/UnifiedInvokerHA.java
Log:
Ensure service name is avail when needed if deployed via -beans.xml

Modified: trunk/cluster/src/main/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java
===================================================================
--- trunk/cluster/src/main/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java	2006-11-18 11:24:51 UTC (rev 58563)
+++ trunk/cluster/src/main/org/jboss/invocation/jrmp/server/JRMPInvokerHA.java	2006-11-18 11:26:20 UTC (rev 58564)
@@ -23,6 +23,7 @@
 
 import java.rmi.MarshalledObject;
 
+import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.management.InstanceNotFoundException;
 import javax.management.ReflectionException;
@@ -57,7 +58,9 @@
    implements InvokerHA
 {
    protected HashMap beanMap = new HashMap();
-
+   
+   protected ObjectName serviceName;
+   
    /**
     * Explicit no-args constructor.
     */
@@ -87,7 +90,7 @@
       }
 
       exportCI();
-      Registry.bind(support.getServiceName(), this);
+      Registry.bind(getServiceName(), this);
    }
 
    protected void stopService() throws Exception
@@ -210,5 +213,32 @@
          Thread.currentThread().setContextClassLoader(oldCl);
       }      
    }
+   
+   public ObjectName getServiceName()
+   {
+      return (serviceName == null ? support.getServiceName() : serviceName);
+   }
+   
+   public void setServiceName(ObjectName serviceName)
+   {
+      this.serviceName = serviceName;
+   }
+
+   @Override
+   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
+   {
+      ObjectName result = super.preRegister(server, name);
+      
+      if (!result.equals(getServiceName()))
+         throw new IllegalStateException("JMX registration (" + result + 
+               ") differs from our configured service name (" + 
+               getServiceName() +")");
+      
+      return result;
+   }
+   
+   
+   
+   
 }
 

Modified: trunk/cluster/src/main/org/jboss/invocation/unified/server/UnifiedInvokerHA.java
===================================================================
--- trunk/cluster/src/main/org/jboss/invocation/unified/server/UnifiedInvokerHA.java	2006-11-18 11:24:51 UTC (rev 58563)
+++ trunk/cluster/src/main/org/jboss/invocation/unified/server/UnifiedInvokerHA.java	2006-11-18 11:26:20 UTC (rev 58564)
@@ -24,6 +24,8 @@
 import java.rmi.MarshalledObject;
 import java.util.ArrayList;
 import java.util.HashMap;
+
+import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import org.jboss.ha.framework.interfaces.GenericClusteringException;
 import org.jboss.ha.framework.interfaces.HARMIResponse;
@@ -186,4 +188,14 @@
 
    }
 
+   @Override
+   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
+   {
+      ObjectName result = super.preRegister(server, name);
+      log.info("Service name is " + getServiceName());
+      return result;
+   }
+   
+   
+
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list