[jboss-user] [JBoss Messaging] - how to prevent others to deploy queue using MBeanServerConne

subrata_jboss do-not-reply at jboss.com
Thu Apr 3 01:50:43 EDT 2008


my problem is i have following program which others can write and deploy a queue in my machine ...

public static void deployQueue(String queueName,InitialContext ic) throws Exception {
MBeanServerConnection mBeanServer = lookupMBeanServerProxy();

ObjectName serverObjectName = new ObjectName(
"jboss.messaging:service=ServerPeer");

mBeanServer.invoke(serverObjectName, "deployQueue", new Object[] {
queueName, queueName, 2000, 2, 2 }, new String[] {
"java.lang.String", "java.lang.String", "int", "int", "int" });

System.out.println("Queue " + queueName + " deployed");
}


++++++++++++++++++++++++++++++++++++++++=
public static MBeanServerConnection lookupMBeanServerProxy()
throws Exception {

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://192.168.114.86:1099");
InitialContext ctx = new InitialContext(p);
return (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
}

How can i configure it so that others can not deploy the queue ??

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

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



More information about the jboss-user mailing list