Java MBean getMbeans( final MBeanServerConnection mBeanServerConnection)

Here you can find the source of getMbeans( final MBeanServerConnection mBeanServerConnection)

Description

Return a list of ZMQ MBean instances.

License

Mozilla Public License

Parameter

Parameter Description
mBeanServerConnection the MBean server open connection

Exception

Parameter Description
MalformedObjectNameExceptionthrows malformed object name exception
IOException throws I/O exception

Return

return the current list ZMQ object instances

Declaration

public static Set<ObjectInstance> getMbeans(
        final MBeanServerConnection mBeanServerConnection)
        throws MalformedObjectNameException, IOException 

Method Source Code

//package com.java2s;
/*//from   w w  w.ja  v  a  2  s  .c o m
 * Copyright (c) 2015 Jeremy Miller
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.io.IOException;

import java.util.Set;

import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;

import javax.management.ObjectInstance;
import javax.management.ObjectName;

public class Main {
    /**
     * Return a list of ZMQ MBean instances.
     * @param  mBeanServerConnection        the MBean server open connection
     * @return                               return the current list ZMQ object instances
     * @throws MalformedObjectNameException  throws malformed object name exception
     * @throws IOException                   throws I/O exception
     */
    public static Set<ObjectInstance> getMbeans(
            final MBeanServerConnection mBeanServerConnection)
            throws MalformedObjectNameException, IOException {

        final ObjectName objectQueryName = new ObjectName(
                "org.zeromq:type=ZMQ,*");
        final Set<ObjectInstance> objectInstances = mBeanServerConnection
                .queryMBeans(objectQueryName, null);

        return objectInstances;
    }
}

Related

  1. getMBeanAttributeMap(MBeanServerConnection server, ObjectName objectName, String delimeter, String... attributeNames)
  2. getMBeanAttributes(final MBeanServer mBeanServer, final String objectNameString)
  3. getMBeanAttributeValue(final MBeanServerConnection connection, final ObjectName objName, final String attributeName)
  4. getMBeanConnections(final Map connectors)
  5. getMBeanName(final String serviceName, final String nameName)
  6. getMBeanServer()
  7. getMbeanServer()
  8. getMBeanServer()
  9. getMBeanServer()