ObjectName

An MBeanServer instance interacts with the MBeans registered with it via their ObjectNames. When an MBean is registered with an MBeanServer, both the MBean object instance and the corresponding MBean ObjectName instance are passed as parameters to the registration method. From this point onwards, the ObjectName is passed to all MBeanServer methods pertaining to this MBean.

ObjectNames are also returned from query methods on the MBeanServer instance which are designed to inquire upon the MBeans registered with the MBeanServer. A form of pattern matching can be used in these methods. Therefore the ObjectName hierarchy corresponding to MQe instrumented resources has been designed to facilitate queries on types of MQe resource such as Application Queue and Indirect Connection.

An object name consists of a string made up of two components: the domain name and the key property list. It has the format:
Domain-name:key1=value1[,key2=value2,...keyX=valueX]
A domain name corresponds to a namespacing prefix which identifies a group of MQe resources.

The following table provides a full description of the MQe JMX object naming conventions.

Table 1. MQe JMX Object Naming Conventions
MQe Resource ObjectName
Local Queue Manager
com.ibm.MQe_LocalQueueManager:name
 = <QMName>
Remote Queue Manager
com.ibm.MQe_RemoteQueueManagers:name
 = <QMName>
Local Queue Manager Alias
com.ibm.MQe_LocalQueueManager:name
 = <QMAliasName>,
type = alias,
resourceName = <QMName>
Remote Queue Manager Alias
com.ibm.MQe_RemoteQueueManagers:name
 = <QMAliasName>,
type = alias,
resourceName = <QMName>
Application Queue
com.ibm.MQe_<OwningQMName>_ApplicationQueues:name
 = <QName>
Application Queue Alias
com.ibm.MQe_<OwningQMName>_ApplicationQueues:name
 = <QAlias>,
type = alias,
resourceName = <QName@OwningQMName>
Sync Proxy Queue
com.ibm.MQe_<OwningQMName>_SyncProxyQueues:name
 = <QName>,
DestinationQMgr = <DestinationQMgrName>
Sync Proxy Queue Alias
com.ibm.MQe_<OwningQMName>_ SyncProxyQueues:name
 = <QAlias>,
type = alias,
resourceName = <QName@DestinationQMgrName>
Async Proxy Queue
com.ibm.MQe_<OwningQMName>_ AsyncProxyQueues:name
 = <QName>,
DestinationQMgr = <DestinationQMgrName>
Async Proxy Queue Alias
com.ibm.MQe_<OwningQMName>_ AsyncProxyQueues:name
 = <QAlias>,
type = alias,
resourceName = <QName@DestinationQMgrName>
Admin Queue
com.ibm.MQe_<OwningQMName>_AdminQueues:name
 = <QName>
Admin Queue Alias
com.ibm.MQe_<OwningQMName>_ AdminQueues:name
 = <QAlias>,
type = alias,
resourceName = <QName@OwningQMName>
Home Server Queue
com.ibm.MQe_<OwningQMName>_HomeServerQueues:name
 = <QName>,
GetFromQMgr = <GetFromQMgr>

Store Queue

com.ibm.MQe_<OwningQMName>_StoreQueues:name
 = <QName>
Forward Queue
com.ibm.MQe_<OwningQMName>_ForwardQueues:name
 = <QName>,
ForwardToQMgr = <ForwardToQMgrName>
MQeMQBridge Queue
com.ibm.MQe_<OwningQMName>_BridgeQueues:name
 = <QName>,
DestinationQMgr = <DestinationQMgrName>
MQeMQBridge Queue Alias
com.ibm.MQe_<OwningQMName>_BridgeQueues:name
 = <QAlias>,
type = alias,
resourceName = <QName@DestinationQMgrName>
Alias Connection
com.ibm.MQe_<OwningQMName>_MQConnections:name
 = <ConnectionName>
Alias Connection Alias
com.ibm.MQe_<OwningQMName>_MQConnections:name
 = <AliasName>,
type = alias,
resourceName = <ConnectionName>
Direct Connection
com.ibm.MQe_<OwningQMName>_DirectConnections:name
 = <ConnectionName>
Direct Connection Alias
com.ibm.MQe_<OwningQMName>_DirectConnections:name
 = <AliasName>,
type = alias,
resourceName = <ConnectionName>
Indirect Connection
com.ibm.MQe_<OwningQMName>_IndirectConnections:name
 = <ConnectionName>
Indirect Connection Alias
com.ibm.MQe_<OwningQMName>_IndirectConnections:name
 = <AliasName>,
type = alias,
resourceName = <ConnectionName>
MQ Connection
com.ibm.MQe_<OwningQMName>_MQConnections:name
 = <ConnectionName>
MQ Connection Alias
com.ibm.MQe_<OwningQMName>_MQConnections:name
 = <AliasName>,
type = alias,
resourceName = <ConnectionName>
Communications Listener
com.ibm.MQe_<OwningQMName>_CommunicationsListeners:name
 = <ListenerName>
MQ Bridge
com.ibm.MQe_<OwningQMName>_Bridges:name
 = <BridgeName>
MQ QMgrProxy
com.ibm.MQe_<OwningQMName>_MQQueueManagerProxies:name
 = <ProxyName>,
bridge = <BridgeName>
MQ Client Connection
com.ibm.MQe_<OwningQMName>_MQClientConnections:name
 = <ClientConnName>,
bridge = <BridgeName>,
qmgrProxy = <ProxyName>
MQ Listener
com.ibm.MQe_<OwningQMName>_MQListeners:name
 = <ListenerName>,
bridge = <BridgeName>,
qmgrProxy = <ProxyName>,
clientConnection = <ClientConnName>
MQe Admin bean
com.ibm.MQe_Admin:name = AdminBean

From the application, using this schema, queries may be done on the MBeans using the name or type fields or wildcards in the string preceding the colon (this string is known as the Domain). Thus it is easy to search for all application queues, all proxy queues, all connection aliases, and so on.

There are some important points to note about the use of ObjectNames for MQe resources:
  • There are no spaces in these names since these make queries more difficult. Therefore, you must ensure that no spaces are accidentally inserted into object names used as parameters to methods, or exceptions will arise due to the resource not being found.
  • Object names are case sensitive.
  • When a queue has an alias, the resourceName property key in the alias MBean object name has a value which is composed of a string of the form queueName@queueManagerName.

The MQe JMX interface provides a helper method to instrument a queue manager's resources as MBeans (The MQeQueueManagerJmx method createMQeMBeans()). When this method is used, all of the MBeans have object names following the pattern specified above. However, it would also be possible for an application to instantiate instances of MQe MBeans by calling the appropriate constructor and it would then be possible to register the resultant MBean with the MBeanServer with an object name chosen by the application.

It is strongly recommended that you adhere to the naming conventions described above and do not register or unregister MQe MBeans independently of the MQe JMX interface. The MQe JMX interface helper method MQeQueueManagerJmx.createMQeMBeans() should always be used to instrument your MQe resources as MBeans.

The only instance where calling the constructor to create a MQe MBean is supported is to change defaults of the Admin MBean. This can be seen in the example code provided in the examples\jmx directory. For example, the register/unregister facilities offered by various adaptors should not be used - going via the MQe JMX interface create and delete methods ensures that MBeans are registered and unregistered in the approved manner (the AdminBean is an exception to this rule).

These conventions are used within the MQe code and the processing of MBeans may not be consistent if a different naming pattern is used. Using the helper method ensures a consistency of behavior, for example, when a refresh occurs on remote queue manager MBeans due to a resource having been added or removed by some method other than via JMX.

The object name patterns described above have been selected with a view to facilitating queries on the MBeanServer instance for its registered MBeans. Such queries allow for pattern-matching based on the object names. (See the JMX resource documentation listed in the preface for descriptions of how MBeanServer queries work). For example, to get a subset of registered MBeans corresponding to a local queue manager's application queues, the following query could be made:

// set up a filter for retrieving MyLocalQM's Application Queue MBeans
ObjectName scope =
   new ObjectName("com.ibm.MQe_MyLocalQM_ApplicationQueues:*"); 

// use the JMX MBeanServer API to make the query
Set results = mbeanServer.queryNames(scope,null);

// iterate through the results
Iterator iter = results.iterator();
ObjectName objName = null;
while(iter.hasNext()) {
objName = (ObjectName)iter.next();
  // process each result
    ...
}

The following example shows how to find out which resources actually represent queue aliases:

// set up a filter for retrieving all aliases for queues
ObjectName scope = new ObjectName("*Queues:*,type=alias"); 

// use the JMX MBeanServer API to make the query
Set results = mbeanServer.queryNames(scope,null);

// etc.

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.