getQueueManagerReference

 

public static MQQueueManager getQueueManagerReference(int scope, 
                                                      Object context);

Returns an MQQueueManager object reference if one is available within the specified scope. The scope must be one of MQC.ASSOCIATE_ALL or MQC.ASSOCIATE_THREAD , and a queue manager must already have been created with MQC.MQ_QMGR_ASSOCIATION_PROPERTY set to the scope requested. The supplied Object gives information necessary to identify the MQQueueManager within the scope; for MQC.ASSOCIATE_ALL and MQC.ASSOCIATE_THREAD this Object must be a String containing the name of the queue manager

If no queue manager identified by the supplied Object has been created within the specified scope, or if MQC.ASSOCIATE_NONE is specified, this method will return null.

An MQQueueManager object returned by this method will refer to the same underlying HConn as the MQQueueManager created with MQC.MQ_QMGR_ASSOCIATION_PROPERTY set, and both will therefore share the same transaction context. If an attempt is made to create a second MQQueueManager object on the same context to a different queue manager, then a separate HConn will be made, and the first and second object will have independent transaction contexts. These contexts will extend to WebSphere MQ coordinated JDBC transactions by using MQQueueManager.getJDBCConnection(XADataSource) on the appropriate queue manager.

Parameters

  • scope - the association scope

  • context - an object containing context. Currently this must be a String specifying a WebSphere MQ queue manager name

Returns

  • MQQueueManager, or null if no reference is available.


uj12640_