Websphere MQ Everyplace

com.ibm.mqe.jms
Class MQeConnectionFactory

java.lang.Object
  |
  +--com.ibm.mqe.jms.MQeConnectionFactory
All Implemented Interfaces:
javax.jms.ConnectionFactory
Direct Known Subclasses:
MQeQueueConnectionFactory

public class MQeConnectionFactory
extends java.lang.Object
implements javax.jms.ConnectionFactory

A ConnectionFactory encapsulates a set of connection configuration parameters that has been defined by an administrator. A client uses it to create a Connection with a JMS provider.

A ConnectionFactory is a JMS administered object. More information on configuring an MQeConnectionFactory can be found in Chapter 10 of the WebSphere MQ Everyplace Application Programming Guide.

See Also:

Constructor Summary
MQeConnectionFactory()
           
 
Method Summary
 java.lang.String getClientID()
          Get the client identifier used by all connections created using this Factory.
 java.lang.String getDescription()
          Get the connection factory description.
 int getDUPSOKCount()
          Get the number of messages that a Session in DUPS_OK_ACKNOWLEDGE mode will receive before acknowledging the messages.
 java.lang.String getIniFileName()
          This method returns the name of the configuration (ini) file which will be used to start a queue manager.
 java.lang.String getTransactionLogURL()
          Get the URL used to store the transaction log.
 void setClientID(java.lang.String id)
          Set the client identifier to be used for all connections created using this Factory.
 void setDescription(java.lang.String desc)
          Set the connection factory description.
 void setDUPSOKCount(int count)
          Set the number of messages that a Session in DUPS_OK_ACKNOWLEDGE mode will accept before acknowledging the received messages.
 void setIniFileName(java.lang.String iniFile)
          This method sets the name of the configuration (ini) file which startQueueManager() uses to start a client queue manager.
 void setTransactionLogURL(java.lang.String url)
          Set the URL to be used to store transaction logs.
 void setVerboseStartup(boolean verbose)
          Display diagnostic information during WebSphere MQ Everyplace Queue Manager startup.
 MQeQueueManager startQueueManager()
          This method is called when it is necessary to start an instance of the MQe queue manager.
 void stopQueueManager()
          This method is called by when the last active connection is closed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQeConnectionFactory

public MQeConnectionFactory()
Method Detail

setClientID

public final void setClientID(java.lang.String id)
Set the client identifier to be used for all connections created using this Factory.

Parameters:
id - The value to be set for the client Id

getClientID

public final java.lang.String getClientID()
Get the client identifier used by all connections created using this Factory.

Returns:
The value currently set for the client Id

setIniFileName

public void setIniFileName(java.lang.String iniFile)
This method sets the name of the configuration (ini) file which startQueueManager() uses to start a client queue manager. If this is set to null, startQueueManager() will try to find a queue manager already running in the JVM, instead of starting a new one.

There would normally be no need to override this method.

Parameters:
iniFile - The name of the ini file to be used to start the queue manager.
Returns:
void

getIniFileName

public java.lang.String getIniFileName()
This method returns the name of the configuration (ini) file which will be used to start a queue manager. This can be null.

There would normally be no need to override this method.

Returns:
The name of the configuration (ini) file which will be used to start the queue manager.

setTransactionLogURL

public void setTransactionLogURL(java.lang.String url)
                          throws javax.jms.JMSException
Set the URL to be used to store transaction logs. If this is left null then defaults will be used.

In WebSphere MQ Everyplace v2.0 the only valid URL is one that refers to the filesystem (i.e. it starts with file://...), for example file://C:\Temp\Logs. By default transaction logs are stored in a subdirectory of the working directory named ./MQe_TL.

Throws:
javax.jms.JMSException - if the URL does not refer to the filesystem

getTransactionLogURL

public java.lang.String getTransactionLogURL()
Get the URL used to store the transaction log.

Returns:
String containing a URL.

setDescription

public final void setDescription(java.lang.String desc)
Set the connection factory description.


getDescription

public final java.lang.String getDescription()
Get the connection factory description.

Returns:
String The description

setDUPSOKCount

public final void setDUPSOKCount(int count)
                          throws javax.jms.JMSException
Set the number of messages that a Session in DUPS_OK_ACKNOWLEDGE mode will accept before acknowledging the received messages. The default value is 10. Setting this to 1 means that each message received is individually acknowledged - i.e. identical behaviour to a session in AUTO_ACKNOWLEDGE mode

Throws:
javax.jms.JMSException - if a zero or negative count in specified

getDUPSOKCount

public final int getDUPSOKCount()
Get the number of messages that a Session in DUPS_OK_ACKNOWLEDGE mode will receive before acknowledging the messages.

Returns:
int the number of messages to receive before acknowledgement

startQueueManager

public MQeQueueManager startQueueManager()
                                  throws javax.jms.JMSException
This method is called when it is necessary to start an instance of the MQe queue manager. By default, it tries to find an instance of the queue manager already running in the JVM. If this fails, then it uses the ini file (if one was specified) to start an instance of MQeJMSQueueManager. If no ini file is specified, and no queue manager is running in the JVM an exception is thrown.

This method can be overridden if the administrator wants to start a queue manager differently. Note that this method is public so that it can be overridden easily (from another package if necessary) and is not intended to be called directly. If this method is overridden then it may also be necessary to override stopQueueManager().

Returns:
The MQeQueueManager object that has been started.
Throws:
java.lang.Exception - propagated if there is an error starting the queue manager.
javax.jms.JMSException

stopQueueManager

public void stopQueueManager()
                      throws java.lang.Exception
This method is called by when the last active connection is closed. If startQueueManager() had started a client queue manager, this method stops it. If startQueueManager() found an instance of a running queue manager, this method doesn’t do anything.

Like startQueueManager, this method is public so that it can be overridden if required, rather than to enable it to be called directly.

Throws:
java.lang.Exception - propagated if there is an error stopping the queue manager.

setVerboseStartup

public void setVerboseStartup(boolean verbose)
Display diagnostic information during WebSphere MQ Everyplace Queue Manager startup. This is intended for debugging purposes, and is set to false by default.


Websphere MQ Everyplace