Hi,

I did indeed found a solution for this.

Check wiki:
http://www.jboss.org/wiki/Wiki.jsp?page=JBossHASingletonRemoteAccess

This wiki explains how to deploy an RMI invoker that can be used to invoke 
methods on singleton MBeans from anywhere in the cluster.
This invoker is deployed as a singleton (deploy-hasingleton) on the each node 
in a cluster, and binds itself to HAJNDI, which makes it available 
cluster-wide. 
The invoker will delegate all calls to it's local MBeanServer. Since the 
RMIAdapter is deployed in the deploy-hasingleton directory, this will always be 
the MBeanServer that is also running the JMS DestinationManager MBean

After you deploy this RMI invoker, you can create a queue at runtime by 
invoking the DestinationManager through this rmi-invoker:

// Get HAJNDI InitialContext
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "localhost:1100");
env.setProperty(Context.URL_PKG_PREFIXES, 
"org.jboss.naming:org.jnp.interfaces");
InitialContext context = new InitialContext(env);

// Get the RMI Invoker
RMIAdaptor rmiAdaptor = (RMIAdaptor) 
context.lookup("jmx/invoker/SingletonRMIAdaptor");

// Create the queue by delegating the call to the 'master' server
// through the RMI invoker
ObjectName objectName = new ObjectName("jboss.mq:service=DestinationManager");
rmiAdaptor.invoke(objectName, "createQueue", new Object[] {name}, new String[] 
{"java.lang.String"});

This solution is working fine for me. Hope it helps you as well.

Regards,
Chris

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to