java.lang.Object | *- com.ibm.mq.MQManagedObject | *- com.ibm.mq.MQQueueManager |
True if the connection to the queue manager is still open.
public MQQueueManager(String queueManagerName)
Throws MQException.
Create a connection to the named queue manager.
The following example shows a connection to a queue manager MYQM, running on a machine with hostname fred.mq.com.
MQEnvironment.hostname = "fred.mq.com"; // host to connect to MQEnvironment.port = 1414; // port to connect to. // If I don't set this, // it defaults to 1414 // (the default WebSphere MQ port) MQEnvironment.channel = "channel.name"; // the CASE-SENSITIVE // name of the // SVR CONN channel on // the queue manager MQQueueManager qMgr = new MQQueueManager("MYQM");
If the queue manager name is left blank (null or ""), a connection is made to the default queue manager.
See also MQEnvironment.
public MQQueueManager(String queueManagerName, MQConnectionManager cxManager)
Throws MQException.
This constructor connects to the specified Queue Manager, using the properties in MQEnvironment. The specified MQConnectionManager manages the connection.
public MQQueueManager(String queueManagerName, ConnectionManager cxManager)
Throws MQException.
This constructor connects to the specified Queue Manager, using the properties in MQEnvironment. The specified ConnectionManager manages the connection.
This constructor requires a JVM at at least Java 2 v1.3, with at least JAAS 1.0 installed.
public MQQueueManager(String queueManagerName, int options)
Throws MQException.
This version of the constructor is intended for use only in bindings mode and it uses the extended connection API (MQCONNX) to connect to the queue manager. The options parameter allows you to choose fast or normal bindings. Possible values are:
public MQQueueManager(String queueManagerName, int options, MQConnectionManager cxManager)
Throws MQException.
This constructor performs an MQCONNX, passing the supplied options. The specified MQConnectionManager manages the connection.
public MQQueueManager(String queueManagerName, int options, ConnectionManager cxManager)
Throws MQException.
This constructor performs an MQCONNX, passing the supplied options. The specified ConnectionManager manages the connection.
This constructor requires a JVM at at least Java 2 v1.3, with at least JAAS 1.0 installed.
public MQQueueManager(String queueManagerName, java.util.Hashtable properties)
The properties parameter takes a series of key/value pairs that describe the WebSphere MQ environment for this particular queue manager. These properties, where specified, override the values set by the MQEnvironment class, and allow the individual properties to be set on a queue manager by queue manager basis. See MQEnvironment.properties.
public MQQueueManager(String queueManagerName, Hashtable properties, MQConnectionManager cxManager)
Throws MQException.
This constructor connects to the named Queue Manager, using the supplied Hashtable of properties to override those in MQEnvironment. The specified MQConnectionManager manages the connection.
public MQQueueManager(String queueManagerName, Hashtable properties, ConnectionManager cxManager)
Throws MQException.
This constructor connects to the named Queue Manager, using the supplied Hashtable of properties to override those in MQEnvironment. The specified ConnectionManager manages the connection.
This constructor requires a JVM at at least Java 2 v1.3, with at least JAAS 1.0 installed.
public synchronized MQDistributionList accessDistributionList ( MQDistributionListItem[] litems, int openOptions, String alternateUserId )
Throws MQException.
Parameters
Throws MQException if the open fails.
See also MQQueueManager.accessQueue.
public synchronized MQDistributionList accessDistributionList ( MQDistributionListItem[] litems, int openOptions, )
Parameters
See accessDistributionList for details of the parameters.
alternateUserId is set to "".
public synchronized MQProcess accessProcess ( String processName, int openOptions, String queueManagerName, String alternateUserId )
Throws MQException.
Establishes access to a WebSphere MQ process on this queue manager to inquire about the process attributes.
Parameters
Valid options are:
If more than one option is required, the values can be added together or combined using the bitwise OR operator. See the WebSphere MQ Application Programming Reference for a fuller description of these options.
public synchronized MQProcess accessProcess ( String processName, int openOptions )
Parameters
See accessProcess for details of the options.
queueManagerName and alternateUserId are set to "".
public synchronized MQQueue accessQueue ( String queueName, int openOptions, String queueManagerName, String dynamicQueueName, String alternateUserId )
Throws MQException.
Establishes access to a WebSphere MQ queue on this queue manager to get or browse messages, put messages, inquire about the attributes of the queue or set the attributes of the queue.
If the queue named is a model queue, then a dynamic local queue is created. The name of the created queue can be determined by inspecting the name attribute of the returned MQQueue object.
Parameters
If more than one option is required, the values can be added together or combined using the bitwise OR operator. See WebSphere MQ Application Programming Reference for a fuller description of these options.
Throws MQException if the open fails.
public synchronized MQQueue accessQueue ( String queueName, int openOptions )
Throws MQException if you call this method after disconnecting from the queue manager.
Parameters
See MQQueueManager.accessQueue for details of the parameters.
For this version of the method, queueManagerName, dynamicQueueName, and alternateUserId are set to "".
Throws MQException if the open fails.
See also MQQueueManager.accessQueue.
public synchronized void backout()
Throws MQException.
Calling this method indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work (with the MQC.MQPMO_SYNCPOINT flag set in the options field of MQPutMessageOptions) are deleted; messages retrieved as part of a unit of work (with the MQC.MQGMO_SYNCPOINT flag set in the options field of MQGetMessageOptions) are reinstated on the queue.
See also the description of the "commit" method.
Throws MQException.
This method is supported only by the WebSphere MQ classes for Java in bindings mode and it signals to the queue manager that a new unit of work is starting.
Do not use this method for applications that use local one-phase transactions.
public synchronized void commit()
Throws MQException.
Calling this method indicates to the queue manager that the application has reached a syncpoint, and that all of the message gets and puts that have occurred since the last syncpoint are to be made permanent. Messages put as part of a unit of work (with the MQC.MQPMO_SYNCPOINT flag set in the options field of MQPutMessageOptions) are made available to other applications. Messages retrieved as part of a unit of work (with the MQC.MQGMO_SYNCPOINT flag set in the options field of MQGetMessageOptions) are deleted.
See also the description of the "backout" method.
public synchronized void disconnect()
Throws MQException.
Terminates the connection to the queue manager. All open queues and processes accessed by this queue manager are closed, and hence become unusable. When you have disconnected from a queue manager the only way to reconnect is to create a new MQQueueManager object.
Normally, any work performed as part of a unit of work is committed. However, if this connection is managed by a ConnectionManager, rather than an MQConnectionManager, the unit of work might be rolled back.
public int getCharacterSet()
Throws MQException.
Returns the CCSID (Coded Character Set Identifier) of the queue manager's codeset. This defines the character set used by the queue manager for all character string fields in the application programming interface.
Throws MQException if you call this method after disconnecting from the queue manager.
public String getCommandInputQueueName()
Throws MQException.
Returns the name of the command input queue defined on the queue manager. This is a queue to which applications can send commands, if authorized to do so.
Throws MQException if you call this method after disconnecting from the queue manager.
public int getCommandLevel()
Throws MQException.
Indicates the level of system control commands supported by the queue manager. The set of system control commands that correspond to a particular command level varies according to the architecture of the platform on which the queue manager is running. See the WebSphere MQ documentation for your platform for further details.
Throws MQException if you call this method after disconnecting from the queue manager.
public boolean getDistributionListCapable()
Indicates whether the queue manager supports distribution lists.
public java.sql.Connection getJDBCConnection(XADataSource dataSource, String userid, String password) throws MQException, SQLException, Exception
Returns a Connection object for use with the JTA-JDBC support.
This method declares Exception in its throws clause so as to avoid problems with the JVM verifier for customers who are not using the JTA functionality. The actual exception thrown is javax.transaction.xa.XAException which would require the jta.jar file to be added to the classpath for programs which didn't previously require it.
Parameters
public java.sql.Connection getJDBCConnection(javax.sql.XADataSource xads) throws MQException, SQLException, Exception
Returns a Connection object for use with the JTA-JDBC support.
This method declares Exception in its throws clause so as to avoid problems with the JVM verifier for customers who are not using the JTA functionality. The actual exception thrown is javax.transaction.xa.XAException which would require the jta.jar file to be added to the classpath for programs which didn't previously require it.
Parameters
public int getMaximumMessageLength()
Throws MQException.
Returns the maximum length of a message (in bytes) that can be handled by the queue manager. No queue can be defined with a maximum message length greater than this.
Throws MQException if you call this method after disconnecting from the queue manager.
public int getMaximumPriority()
Throws MQException.
Returns the maximum message priority supported by the queue manager. Priorities range from zero (lowest) to this value.
Throws MQException if you call this method after disconnecting from the queue manager.
public int getSyncpointAvailability()
Throws MQException.
Indicates whether the queue manager supports units of work and syncpointing with the MQQueue.get and MQQueue.put methods.
Returns
Throws MQException if you call this method after disconnecting from the queue manager.
public boolean isConnected()
Returns the value of the isConnected variable.
public synchronized void put(String qName, String qmName, MQMessage msg, MQPutMessageOptions pmo, String altUserId) throws MQException
Places a single message onto a queue without having to create a MQQueue object first.
The qName (queue name) and qmName (queue manager name) parameters identify where the message is placed. If the queue is a model queue then an MQException is thrown.
In other respects, this method behaves like the put method on the MQQueue object. It is an implementation of the MQPUT1 MQI call. See MQQueue.put.
Parameters
public synchronized void put(String qName, String qmName, MQMessage msg, MQPutMessageOptions pmo) throws MQException
Places a single message onto a queue without having to create a MQQueue object first.
This version of the method allows you to omit the altUserid parameter. See the fully-specified method (MQQueueManager.put) for details of the parameters.
public synchronized void put(String qName, String qmName, MQMessage msg) throws MQException
Places a single message onto a queue without having to create a MQQueue object first.
This version of the method allows you to omit the put message options (pmo) and altUserid parameters. See the fully-specified method (MQQueueManager.put) for details of the parameters.
public synchronized void put(String qName, MQMessage msg, MQPutMessageOptions pmo) throws MQException
Places a single message onto a queue without having to create a MQQueue object first.
This version of the method allows you to omit the qmName and altUserid parameters. See the fully-specified method (MQQueueManager.put) for details of the parameters.
public synchronized void put(String qName, MQMessage msg) throws MQException
Places a single message onto a queue without having to create a MQQueue object first.
This version of the method allows you to omit the qmName, put message options (pmo), and altUserid parameters. See the fully-specified method (MQQueueManager.put) for details of the parameters.