Package javax.management

Examples of javax.management.MBeanServerConnection.invoke()


     
      MBeanServerConnection[] adaptors = getAdaptors();
      MBeanServerConnection server0 = adaptors[0];
      ObjectName rpcService = new ObjectName(RPC_ONENODE_SERVICE);

      Object obj0 = server0.invoke(rpcService, "runRetrieveAll", null, null);
      assertNotNull("expected ArrayList as result type, got null", obj0);
      assertTrue( "expected ArrayList as result type, got " +obj0.getClass().getName(), obj0 instanceof ArrayList);
      ArrayList responses = (ArrayList)obj0;
     
      // there should be one response as the service is only registered on one node
View Full Code Here


      PersonQuery query = new PersonQuery();
      query.setEmployer(employer);
      Object[] parms = new Object[]{query};
      String[] types = new String[]{PersonQuery.class.getName()};
     
      Object obj1 = server1.invoke(rpcService, "runRetrieveQuery", parms, types);
      assertNotNull("expected ArrayList as result type, got null", obj1);
      assertTrue( "expected ArrayList as result type, got " +obj1.getClass().getName(), obj1 instanceof ArrayList);
      ArrayList responses = (ArrayList)obj1;
     
      // there should be one response as the service is only registered on one node
View Full Code Here

      PersonQuery query = new PersonQuery();
      query.setEmployer(employer);
      Object[] parms = new Object[]{query};
      String[] types = new String[]{PersonQuery.class.getName()};
     
      Object obj1 = server1.invoke(rpcService, "runRetrieveQuery", parms, types);
      assertNotNull("expected ArrayList as result type, got null", obj1);
      assertTrue( "expected ArrayList as result type, got " +obj1.getClass().getName(), obj1 instanceof ArrayList);
      ArrayList responses = (ArrayList)obj1;
     
      // there should be two responses, a Person and a null value
View Full Code Here

        JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, environment);
        try {
            MBeanServerConnection mbServer = jmxConnector.getMBeanServerConnection();

            ObjectName configStore = locateConfigStore(mbServer, storeName);
            mbServer.invoke(configStore, "install", new Object[]{getArtifact().toURL()}, new String[]{URL.class.getName()});
            System.out.println("Distributed " + getArtifact() + " to " + getUrl());
        } finally {
            jmxConnector.close();
        }
    }
View Full Code Here

         MBeanServerConnection mbsc =  jmxConnector.getMBeanServerConnection();
         ObjectName virtualHost = new ObjectName("org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=\"test\"");

         Object[] params = new Object[] {queueName, owner, true, arguments};
         String[] signature = new String[] {String.class.getName(), String.class.getName(), boolean.class.getName(), Map.class.getName()};
         mbsc.invoke(virtualHost, "createNewQueue", params, signature);

         ObjectName directExchange = new ObjectName("org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=\"test\",name=\"amq.direct\",ExchangeType=direct");
         mbsc.invoke(directExchange, "createNewBinding", new Object[] {queueName, queueName}, new String[] {String.class.getName(), String.class.getName()});
    }
    /**
 
View Full Code Here

         Object[] params = new Object[] {queueName, owner, true, arguments};
         String[] signature = new String[] {String.class.getName(), String.class.getName(), boolean.class.getName(), Map.class.getName()};
         mbsc.invoke(virtualHost, "createNewQueue", params, signature);

         ObjectName directExchange = new ObjectName("org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=\"test\",name=\"amq.direct\",ExchangeType=direct");
         mbsc.invoke(directExchange, "createNewBinding", new Object[] {queueName, queueName}, new String[] {String.class.getName(), String.class.getName()});
    }
    /**
     * Prepare a DurableSubscription backing queue for use in testing selector
     * recovery and queue exclusivity marking during the upgrade process.
     *
 
View Full Code Here

            ObjectName objectName = new ObjectName("jboss:name=test,type=rar");

            MBeanServerConnection mbeanServer = utils.getServerOneConnection();

            System.out.println("Calling TestMBean.helloWorld() on server one");
            String s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[0], new String[0]);
            System.out.println("Received reply: " + s);

            System.out.println("Calling TestMBean.helloWorld(\"AS7\") on server one");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[] { "AS7" },
                    new String[] { "java.lang.String" });
View Full Code Here

            System.out.println("Calling TestMBean.helloWorld() on server one");
            String s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[0], new String[0]);
            System.out.println("Received reply: " + s);

            System.out.println("Calling TestMBean.helloWorld(\"AS7\") on server one");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[] { "AS7" },
                    new String[] { "java.lang.String" });
            System.out.println("Received reply: " + s);

            mbeanServer = utils.getServerTwoConnection();
View Full Code Here

            System.out.println("Received reply: " + s);

            mbeanServer = utils.getServerTwoConnection();

            System.out.println("Calling TestMBean.helloWorld() on server two");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[0], new String[0]);
            System.out.println("Received reply: " + s);

            System.out.println("Calling TestMBean.helloWorld(\"AS7\") on server two");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[] { "AS7" },
                    new String[] { "java.lang.String" });
View Full Code Here

            System.out.println("Calling TestMBean.helloWorld() on server two");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[0], new String[0]);
            System.out.println("Received reply: " + s);

            System.out.println("Calling TestMBean.helloWorld(\"AS7\") on server two");
            s = (String) mbeanServer.invoke(objectName, "helloWorld", new Object[] { "AS7" },
                    new String[] { "java.lang.String" });
            System.out.println("Received reply: " + s);
        } finally {
            utils.undeploy();
            safeClose(utils);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.