The MQe JMX interface provides the instrumentation level of the JMX architecture. We are not providing an implementation of the agent level, which is made up of the MBeanServer and the JMX agent services. Since the role of the MBean server is to act as a registry for MBeans, the user's instance of MBean server has to be passed to the instrumentation code via the MQeQueueManagerJmx.createMQeMBeans() method described in this section. All instrumented MQe MBeans are then registered with this MBeanServer instance.
An instance of an MBeanServer is created using one of two static methods of the MBeanServerFactory class: createMBeanServer() or newMBeanServer(). Once this instance has been created, MBeanServer methods can be used to access and manipulate the MBeans registered with the MBeanServer. In particular, the following methods allow the user to retrieve and set MQe MBean attributes and invoke operations. (The method names below assume that mbeanServer is the instance of MBeanServer.)
mbeanServer.getAttribute(ObjectName objName, String attributeName); mbeanServer.getAttributes(ObjectName objName, String[] attributeNames); mbeanServer.setAttribute(ObjectName objName, Attribute attribute); mbeanServer.setAttributes(ObjectName objName, AttributeList attributes); mbeanServer.invoke( ObjectName name, String operationName, Object params[], String signature[] );
For further details on the parameter types Attribute and AttributeList, see Related information on JMX. The concept of an MBean's ObjectName is central to the MQe JMX interface and is discussed in the following section.