1 Reply Latest reply on Apr 9, 2008 10:39 AM by Jeff Mesnil

    how to prevent others to deploy queue using MBeanServerConne

    Subrata Saha Newbie

      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 ??

        • 1. Re: how to prevent others to deploy queue using MBeanServerC
          Jeff Mesnil Master

           

          "subrata_jboss" wrote:
          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 {
          ...
          }

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


          Why don't you decrease the visibility of the deployQueue() method so that it can not be called by anybody but you?

          It seems the issue is more related to your API than to JBoss Messaging deployment...

          hope it helps,
          jeff