Implicit operations

Several operations can occur implicitly, "just in time" to satisfy the prerequisite conditions for the successful execution of a method. These implicit operations are connect, open, reopen, close, and disconnect. 2

Connect

An ImqQueueManager object is connected automatically for any method that results in any call to the MQI (see Appendix B, MQI cross reference).

Open

An ImqObject object is opened automatically for any method that results in an MQGET, MQINQ, MQPUT or MQSET call. The openFor method is used to specify one or more relevant open option values.

Reopen

An ImqObject is reopened automatically for any method that results in an MQGET, MQINQ, MQPUT or MQSET call, where the object is already open, but the existing open options are not adequate to allow the MQI call to be successful. The object is temporarily closed using a temporary close options value of MQCO_NONE. The openFor method is used to add a relevant open option.

Reopen can cause problems in specific circumstances:

If any of these circumstances occur or can be foreseen, avoid reopens by explicitly setting adequate open options before an object is opened (either explicitly or implicitly).

Setting the open options explicitly for complex queue-handling situations results in better performance and avoids the problems associated with the use of reopen.

Close

An ImqObject is closed automatically at any point where the object state would no longer be viable, for example if an ImqObject connection reference is severed, or if an ImqObject object is destroyed.

Disconnect

An ImqQueueManager is disconnected automatically at any point where the connection would no longer be viable, for example if an ImqObject connection reference is severed, or if an ImqQueueManager object is destroyed.


Footnotes:

2
Connect and open implicit behavior is controllable using class attributes.


© IBM Corporation 2001. All Rights Reserved