Package javax.management

Examples of javax.management.ObjectName


      sc.unregisterService(objectName);
   }

   public void configureSecurityForDestination(String destName, String config) throws Exception
   {
      Set s = sc.query(new ObjectName("*:service=Queue,name=" + destName));
      for(Iterator i = s.iterator(); i.hasNext();)
      {
         ObjectName on = (ObjectName)i.next();
         sc.setAttribute(on, "SecurityConfig", config);
      }

      s = sc.query(new ObjectName("*:service=Topic,name=" + destName));
      for(Iterator i = s.iterator(); i.hasNext();)
      {
         ObjectName on = (ObjectName)i.next();
         sc.setAttribute(on, "SecurityConfig", config);
      }
   }
View Full Code Here


      //this should be combined

      String destType = isQueue ? "Queue" : "Topic";
      String className = "org.jboss.jms.server.destination." + destType + "Service";
      String ons ="jboss.messaging.destination:service="+ destType + ",name=" + name;
      ObjectName on = new ObjectName(ons);

      String destinationMBeanConfig =
         "<mbean code=\"" + className + "\" " +
         "       name=\"" + ons + "\" " +
         "       xmbean-dd=\"xmdesc/" + destType + "-xmbean.xml\">\n" +
View Full Code Here

     
      String destType = isQueue ? "Queue" : "Topic";
      String className = "org.jboss.jms.server.destination." + destType + "Service";
     
      String ons ="jboss.messaging.destination:service="+ destType + ",name=" + name;
      ObjectName on = new ObjectName(ons);
     
      String destinationMBeanConfig =
         "<mbean code=\"" + className + "\" " +
         "       name=\"" + ons + "\" " +
         "       xmbean-dd=\"xmdesc/" + destType + "-xmbean.xml\">\n" +
View Full Code Here

      Element element = Util.stringToElement(destinationMBeanConfig);

      ServiceCreator sc = new ServiceCreator(mbeanServer);

      ClassLoader cl = this.getClass().getClassLoader();
      ObjectName loaderObjectName = null;
      if (cl instanceof UnifiedClassLoader3)
      {
         loaderObjectName = ((UnifiedClassLoader3)cl).getObjectName();
      }
View Full Code Here

    */
   private boolean undeployDestination(boolean isQueue, String name) throws Exception
   {
      String destType = isQueue ? "Queue" : "Topic";
      String ons ="jboss.messaging.destination:service=" + destType + ",name=" + name;
      ObjectName on = new ObjectName(ons);

      MBeanServer mbeanServer = getServer();

      // we can only undeploy destinations that exist AND that have been created programatically
      if (!mbeanServer.isRegistered(on))
View Full Code Here

    */
   private boolean destroyDestination(boolean isQueue, String name) throws Exception
   {
      String destType = isQueue ? "Queue" : "Topic";
      String ons ="jboss.messaging.destination:service=" + destType + ",name=" + name;
      ObjectName on = new ObjectName(ons);

      MBeanServer mbeanServer = getServer();

      // we can only destroy destinations that exist AND that have been created programatically
      if (!mbeanServer.isRegistered(on))
View Full Code Here

      try
      {
         // configure the queue to allow "def" to read
         String config = "<security><role name=\"def\" read=\"true\" write=\"false\" create=\"false\"/></security>";
         ObjectName on = new ObjectName("jboss.messaging.destination:service=Queue,name=Accounting");
         ServerManagement.setAttribute(on, "SecurityConfig", config);

         // configure the topic to prevent "def" from reading
         config = "<security><role name=\"def\" read=\"false\" write=\"false\" create=\"false\"/></security>";
         on = new ObjectName("jboss.messaging.destination:service=Topic,name=Accounting");
         ServerManagement.setAttribute(on, "SecurityConfig", config);

         Queue queue = (Queue)ic.lookup("/queue/Accounting");
         Topic topic = (Topic)ic.lookup("/topic/Accounting");
View Full Code Here

   public void testMessageRedistributionAmongNodes() throws Exception
   {
      // start servers with redistribution policies that actually do something
      ServiceAttributeOverrides attrOverrides = new ServiceAttributeOverrides();

      ObjectName postOfficeObjectName = new ObjectName("jboss.messaging:service=PostOffice");

      attrOverrides.
         put(postOfficeObjectName, "MessagePullPolicy",
             "org.jboss.messaging.core.plugin.postoffice.cluster.DefaultMessagePullPolicy");
View Full Code Here

         "          </bindings>\n" +
         "       </attribute>\n" +
         "       <attribute name=\"DupsOKBatchSize\">" + BATCH_SIZE  + "</attribute>" +
         " </mbean>";

      ObjectName on = ServerManagement.deploy(mbeanConfig);
      ServerManagement.invoke(on, "create", new Object[0], new String[0]);
      ServerManagement.invoke(on, "start", new Object[0], new String[0]);
     
      ConnectionFactory myCF = (ConnectionFactory)initialContext.lookup("/mycf");
     
View Full Code Here

  
   private boolean assertRemainingMessages(int expected) throws Exception
   {
      //Need to pause since delivery may still be in progress
      Thread.sleep(500);
      ObjectName destObjectName =
         new ObjectName("jboss.messaging.destination:service=Queue,name=Queue");
      Integer messageCount = (Integer)ServerManagement.getAttribute(destObjectName, "MessageCount");
     
      log.trace("There are " + messageCount + " messages");
     
      assertEquals(expected, messageCount.intValue());     
View Full Code Here

TOP

Related Classes of javax.management.ObjectName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.