[jboss-user] [Clustering/JBoss] - Re: get partition(cluster)

JerryGauth do-not-reply at jboss.com
Tue Mar 13 16:04:06 EDT 2007


I'm not clear on whether you're trying to access the DistributedReplicantManager service remotely or if you're looking for something else.  Here's an example of how to use the DRM service remotely in JBoss 4.0.5.  Note that your remote client will need various JBoss jars on its classpath.  You'll get runtime errors on your client until the classpath is set properly.

// method 1 - using JBoss RMIAdaptor
//RMIAdaptor server1 = (RMIAdaptor)ic.lookup("jmx/invoker/RMIAdaptor");
//System.out.println("MBean count=" + server1.getMBeanCount());
        	
// method 2 - using javax.management in JDK 1.5, same object type is returned in JBossAS
MBeanServerConnection server2 = (MBeanServerConnection)ic.lookup("jmx/invoker/RMIAdaptor");
System.out.println("MBean count=" + server2.getMBeanCount());
            
ObjectName clusterService = new   ObjectName("jboss:partitionName=DefaultPartition,service=DistributedReplicantManager");
String drm_content = (String)server2.invoke(clusterService, "listContent", null, null);
System.out.println(drm_content);

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027669#4027669

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027669



More information about the jboss-user mailing list