Package javax.management

Examples of javax.management.MBeanServerConnection.queryNames()


         sleep(5000);
         JMXConnector cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
         try
         {
            MBeanServerConnection server = cntor.getMBeanServerConnection();
            Set names = server.queryNames(null, null);
            assertNotNull(names);
            assertTrue(names.size() > 0);
            assertEquals(names.size(), server.getMBeanCount().intValue());
         }
         finally
View Full Code Here


        final MBeanServerConnection serverConn = getMBeanServerConnection();
       
        return AccessController.doPrivileged(
            new PrivilegedExceptionAction<Set<ObjectName>>() {
                public Set<ObjectName> run() throws IOException {
                    return serverConn.queryNames(derbyDomain, null);
               }  
            }
        );  
    }
   
View Full Code Here

    {
        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
       
        //Detect if the ServerInformation MBean is present, and use it to retrieve the API version.
        ObjectName objName = new ObjectName(server.getDomain() + ":type="+ ServerInformation.TYPE + ",*");
        Set<ObjectName> objectInstances = mbsc.queryNames(objName, null);
       
        if(objectInstances.size() != 0)
        {
            for (Iterator<ObjectName> itr = objectInstances.iterator(); itr.hasNext();)
            {
View Full Code Here

    {
        JMXConnector con = getJMXConnection(host, port);
        MBeanServerConnection mbsc = con.getMBeanServerConnection();

        // Gets all tmp_* queue MBean ObjectNames
        Set<ObjectName> names = mbsc.queryNames(
                                new ObjectName("org.apache.qpid:type=VirtualHost.Queue,name=tmp_*,*"), null);

        // Traverse objects and delete specified number of message if the min msg count is breached
        for (ObjectName queueObjectName : names)
        {
View Full Code Here

            ObjectName hostManagerObjectName = new ObjectName(
                    "org.apache.qpid:" +
                    "type=VirtualHost.VirtualHostManager," +
                    "VirtualHost=" + virHost + ",*");

            Set<ObjectName> vhostManagers = mbsc.queryNames(hostManagerObjectName, null);
           
            if(vhostManagers.size() == 0)
            {
                //The vhostManager MBean wasnt found, cant procede
                return false;
View Full Code Here

                    "type=VirtualHost.Exchange," +
                    "VirtualHost=" + virHost + "," +
                    "name=" + exchName + "," +
                    "ExchangeType=direct,*");

            Set<ObjectName> exchanges = mbsc.queryNames(customExchangeObjectName, null);
           
            if(exchanges.size() == 0)
            {
                //The exchange doesnt exist, cant procede.
                return false;
View Full Code Here

        //
        // First get the broker name
        //
        ObjectName brokerObjectName = null;       
        for (Object nameObject : conn.queryNames(new ObjectName(jmxDomain + ":*,Type=Broker"), (QueryExp) null)) {
            //find the brokername object
            brokerObjectName = (ObjectName) nameObject;
            //if (brokerObjectName.getCanonicalName().endsWith("Type=Broker")) {
                // Extract just the name from the canonical name
                //String brokerName = brokerObjectName.getCanonicalName().substring(0, brokerObjectName.getCanonicalName().indexOf(","));
View Full Code Here

    public void testSimpleRemoteJmx() throws Exception {
        // Retrieve an MBeanServerConnection that represent the MBeanServer the remote
        // connector server is bound to
        MBeanServerConnection connection = connector.getMBeanServerConnection();
        ObjectName queryName = new ObjectName("*:*");
        java.util.Set names = connection.queryNames(queryName, null);
        for (Iterator iter = names.iterator(); iter.hasNext();) {
            ObjectName name = (ObjectName) iter.next();
            MBeanInfo beanInfo = connection.getMBeanInfo(name);
            System.out.println("bean info = " + beanInfo.getDescription());
            System.out.println("attrs = " + Arrays.asList(beanInfo.getAttributes()));
View Full Code Here

    }

    public void shutdown() throws Exception {
        MBeanServerConnection connection = getConnection();
        Set<ObjectName> objectNameSet =
            connection.queryNames(new ObjectName("osgi.core:type=framework,*"), null);
        if (objectNameSet.isEmpty()) {
            throw new Exception("Framework mbean not found");
        } else if (objectNameSet.size() == 1) {
            connection.invoke(objectNameSet.iterator().next(), "stopBundle",
                              new Object[] { 0 }, new String[] { long.class.getName() });
View Full Code Here

            ObjectName hostManagerObjectName = new ObjectName(
                    "org.apache.qpid:" +
                    "type=VirtualHost.VirtualHostManager," +
                    "VirtualHost=" + ObjectName.quote(virHost) + ",*");

            Set<ObjectName> vhostManagers = mbsc.queryNames(hostManagerObjectName, null);

            if(vhostManagers.size() == 0)
            {
                System.out.println("VirtualHostManager MBean wasnt found: " + virHost);

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.