MQConnectionFactory

public class MQConnectionFactory
extends Object
implements ConnectionFactoryReferenceableSerializable
java.lang.Object
   |
   +----com.ibm.mq.jms.MQConnectionFactory
          

MQConnectionFactory is the WebSphere MQ implementation of 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.

Constructors

MQConnectionFactory

public MQConnectionFactory();

This is the default constructor. It will create an MQConnectionFactory with all properties set to their default values.

Methods

createConnection

public Connection createConnection() throws JMSException;

Creates a connection with the default user identity. The connection is created in stopped mode. No messages are delivered until Connection.start() is explicitly called.

Returns
Exceptions

createConnection

public Connection createConnection(String userName, String password) 
              throws JMSException;

Creates a connection with the specified user identity. The connection is created in stopped mode. No messages are delivered until Connection.start() is explicitly called.

Parameters
Returns
Exceptions

getBrokerCCSubQueue

public String getBrokerCCSubQueue() throws JMSException;

Gets the broker's queue name for nondurable connection consumers.

Returns
Exceptions

getBrokerControlQueue

public String getBrokerControlQueue() throws JMSException;

Gets the broker's control queue name.

Returns
Exceptions

getBrokerPubQueue

public String getBrokerPubQueue() throws JMSException;

Gets the broker's publish queue name.

Returns
Exceptions

getBrokerQueueManager

public String getBrokerQueueManager() throws JMSException;

Gets the name of the broker's queue manager.

Returns
Exceptions

getBrokerSubQueue

public String getBrokerSubQueue() throws JMSException;

Gets the broker's queue name for nondurable subscribers.

Returns
Exceptions

getBrokerVersion

public int getBrokerVersion() throws JMSException;

Gets the version number of the broker.

Returns
Exceptions

getCCDTURL

public URL getCCDTURL();

Gets the URL for the client channel definition table.

Returns

getCCSID

public int getCCSID();

Gets the character set of the queue manager.

Returns

getChannel

public String getChannel();

Gets the name of the channel that was used.

Returns

getCleanupInterval

public long getCleanupInterval() throws JMSException;

Gets the clean up interval.

Returns
Exceptions

getCleanupLevel

public int getCleanupLevel() throws JMSException;

Gets the clean up level.

Returns
Exceptions

getClientId

public String getClientId();

Deprecated

use the getClientID() method instead.

Returns

getClientID

public String getClientID();

Gets the client ID.

Returns

getCloneSupport

public int getCloneSupport() throws JMSException;

Indicates whether cloning is supported.

Returns
Exceptions

getConnTag

public byte[] getConnTag();

Gets the value of the queue manager connection tag. It is used by the queue manager to serialize access to the affected resources. This tag is only used when connecting to a z/OS queue manager. On other platforms it will have the value MQCT_NONE - its default value.

Returns

getDescription

public String getDescription();

Gets the description.

Returns

getDirectAuth

public int getDirectAuth() throws JMSException;

Gets the type of direct authentication that is required.

Returns
Exceptions

getFailIfQuiesce

public int getFailIfQuiesce();

Indicates the default behavior of applications accessing a quiescing queue manager.

Returns

getHdrCompList

public Collection getHdrCompList();

Gets the list of header compression techniques which has been set.

Returns

getHostName

public String getHostName();

Gets the name of the host. This only applies for client connections or direct TCP/IP connections to WebSphere MQ.

Returns

getLocalAddress

public String getLocalAddress();

Gets the local address.

Returns

getMapNameStyle

public boolean getMapNameStyle();

Allows compatibility style to be used for MapMessage element names.

Returns

getMessageRetention

public int getMessageRetention() throws JMSException;

Indicates what happens to unwanted messages.

Returns
Exceptions

getMessageSelection

public int getMessageSelection() throws JMSException;

Indicates whether the client or the broker performs message selection.

Returns
Exceptions

getMQConnectionOptions

public int getMQConnectionOptions();

Gets the connection options.

Returns

getMsgBatchSize

public int getMsgBatchSize();

Gets the message batch size.

Returns

getMsgCompList

public Collection getMsgCompList();

Gets the list of message compression techniques that have been set.

Returns

getMulticast

public int getMulticast() throws JMSException;

Gets the value of the multicast attribute.

Returns
Exceptions

getOptimisticPublication

public boolean getOptimisticPublication() throws JMSException;

Indicates whether transactional publish/subscribe MessageProducers should return immediately from a send/publish call rather than wait until the message has completed delivery. If false, failure to deliver the message will only be reported when the message is committed.

Returns
Exceptions

getOutcomeNotification

public boolean getOutcomeNotification() throws JMSException;

Indicates whether the publish/subscribe MessageConsumers are informed of the outcome of acknowledge or commit calls after receiving messages.

Returns

getPollingInterval

public int getPollingInterval();

Gets the interval between scans of all receivers during asynchronous message delivery.

Returns

getPort

public int getPort();

Gets the port number. Applies to client connections or direct TCP/IP connection to a broker.

Returns

getProcessDuration

public int getProcessDuration() throws JMSException;

Indicates how promptly received messages are processed. While this alone does not make any difference, quickly processing messages is a prerequisite for viewing uncommitted messages.

Returns

getProxyHostName

public String getProxyHostName() throws JMSException;

Gets the proxy host name.

Returns
Exceptions

getProxyPort

public int getProxyPort() throws JMSException;

Gets the port number of the proxy server.

Returns
Exceptions

getPubAckInterval

public int getPubAckInterval() throws JMSException;

Gets the number of messages that can be published before requiring acknowledgement from the broker.

Returns
Exceptions

getQueueManager

public String getQueueManager();

Gets the name of the queue manager.

Returns

getReceiveExit

public String getReceiveExit();

Gets the description of the receive exit.

Returns

getReceiveExitInit

public String getReceiveExitInit();

Gets the initialization string for the receive exit.

Returns

getReceiveIsolation

public int getReceiveIsolation() throws JMSException;

Indicates whether calls by MessageConsumers are isolated from other operations.

Returns
Exceptions

getReference

public Reference getReference() throws NamingException;

Creates a reference for this queue connection factory.

Returns
Exceptions

getRescanInterval

public int getRescanInterval();

Gets the interval between browse scans of a queue. The scan looks for messages that have not been returned by the previous browse scan.

Returns

getSecurityExit

public String getSecurityExit();

Gets the description of the security exit.

Returns

getSecurityExitInit

public String getSecurityExitInit();

Gets the initialization string for the security exit.

Returns

getSendExit

public String getSendExit();

Gets the description of the send exit.

Returns

getSendExitInit

public String getSendExitInit();

Gets the initialization string for the send exit.

Returns

getSparseSubscriptions

public boolean getSparseSubscriptions() throws JMSException;

Gets the sparse subscriptions attribute. A sparse subscription is one that receives infrequent matching messages. If the attribute is true the application must be able to open the consumer queue for browsing messages.

Returns
Exceptions

getSSLCertStores

public Collection getSSLCertStores() throws JMSException;

Gets the collection of CertStore objects.

Returns
Exceptions

getSSLCertStoresAsString

public String getSSLCertStoresAsString() throws JMSException;

Gets the collection of CertStore objects as a String.

Returns
Exceptions

getSSLCipherSuite

public String getSSLCipherSuite();

Gets the CipherSuite used for SSL encryption.

Returns

getSSLFipsRequired

public boolean getSSLFipsRequired();

Indicates whether sslFips (FIPS) is required.

Returns

getSSLPeerName

public String getSSLPeerName();

Gets the distinguished name pattern used to validate the queue manager.

Returns

getSSLResetCount

public int getSSLResetCount();

Gets the SSL reset count.

Returns

getSSLSocketFactory

public Object getSSLSocketFactory();

Gets the SSLSocketFactory used with SSL encryption.

Returns

getStatusRefreshInterval

public int getStatusRefreshInterval() throws JMSException;

Gets the status refresh interval.

Returns
Exceptions

getSubscriptionStore

public int getSubscriptionStore() throws JMSException;

Gets the SUBSTORE property.

Returns
Exceptions

getSyncpointAllGets

public boolean getSyncpointAllGets();

Indicates how syncpoint is used for GET operations.

Returns

getTargetClientMatching

public boolean getTargetClientMatching();

is target client matching enabled.

Returns

getTemporaryModel

public String getTemporaryModel() throws JMSException;

Gets the name of a model queue for creating temporary destinations.

Returns
Exceptions

getTempQPrefix

public String getTempQPrefix() throws JMSException;

Gets the prefix used to form the name of a WebSphere MQ dynamic queue.

Returns
Exceptions

getTransportType

public int getTransportType();

Gets the transport type.

Returns

getUseConnectionPooling

public boolean getUseConnectionPooling();

Indicates whether connection pooling has been selected.

Returns

getVersion

public int getVersion();

Gets the version number.

Returns

setBrokerCCSubQueue

public void setBrokerCCSubQueue(String queueName) throws JMSException;

Sets the name of the broker nondurable connection consumer subscriber queue.

Parameters
Exceptions

setBrokerControlQueue

public void setBrokerControlQueue(String queueName) throws JMSException;

Sets the name of the broker control queue.

Parameters
Exceptions

setBrokerPubQueue

public void setBrokerPubQueue(String queueName) throws JMSException;

Sets the name of the broker's publish queue. Note that if this is a user-defined queue, the broker must already be aware of this queue before connecting to the broker.

Parameters
Exceptions

setBrokerQueueManager

public void setBrokerQueueManager(String queueManagerName) 
              throws JMSException;

Sets the name of the broker's queue manager.

Parameters
Exceptions

setBrokerSubQueue

public void setBrokerSubQueue(String queueName) throws JMSException;

Gets the name of the broker nondurable subscriber queue.

Parameters
Exceptions

setBrokerVersion

public void setBrokerVersion(int version) throws JMSException;

Sets the version of the broker.

Parameters
Exceptions

setCCDTURL

public void setCCDTURL(URL url);

Sets the URL for the client channel definition table.

Parameters

setCCSID

public void setCCSID(int ccsid) throws JMSException;

Sets the character set to be used when connecting to the queue manager.

Parameters
Exceptions

setChannel

public void setChannel(String channelName) throws JMSException;

Sets the name of the channel - applies to clients only.

Parameters
Exceptions

setCleanupInterval

public void setCleanupInterval(long interval) throws JMSException;

Sets the clean up interval.

Parameters
Exceptions

setCleanupLevel

public void setCleanupLevel(int level) throws JMSException;

Sets the clean up level.

Parameters
Exceptions

setClientId

public void setClientId(String id);

Deprecated

Use the setClientID() method instead.

Parameters

setClientID

public void setClientID(String id);

Sets the client ID.

Note that this method always throws an IllegalStateException when you make a direct connection to a broker.

Parameters

setCloneSupport

public void setCloneSupport(int type) throws JMSException;

Selects whether cloning is supported.

Parameters
Exceptions

setConnTag

public void setConnTag(byte[] cTag);

Sets the value of the queue manager connection tag. It is used by the queue manager to serialize access to the affected resources. This tag is only used when connecting to a z/OS queue manager. On other platforms it must have the value MQCT_NONE - its default value.

Parameters

setDescription

public void setDescription(String desc);

Sets the description.

Parameters

setDirectAuth

public void setDirectAuth(int authority) throws JMSException;

Sets the type of direct authentication that is required.

Parameters
Exceptions

setFailIfQuiesce

public void setFailIfQuiesce(int fiq) throws JMSException;

Sets the default behavior of applications accessing a quiescing queue manager.

Parameters
Exceptions

setHdrCompList

public void setHdrCompList(Collection compList) throws JMSException;

Sets the list of header compression techniques.

Parameters

setHostName

public void setHostName(String hostname);

Sets the name of the host. This only applies for client connections or direct TCP/IP connections to WebSphere MQ.

Parameters

setLocalAddress

public void setLocalAddress(String address) throws JMSException;

Sets the local address.

Parameters
Exceptions

setMapNameStyle

public void setMapNameStyle(boolean style);

Allows compatibility style to be used for MapMessage element names.

Parameters

setMessageRetention

public void setMessageRetention(int mRet) throws JMSException;

Sets what happens to unwanted messages.

Parameters
Exceptions

setMessageSelection

public void setMessageSelection(int selection) throws JMSException;

Sets whether the client or the broker performs message selection.

Parameters
Exceptions

setMQConnectionOptions

public void setMQConnectionOptions(int cTagOpt) throws JMSException;

Sets the connection options for a queue manager. This method checks that the options are valid for JMS.

Parameters
Exceptions

setMsgBatchSize

public void setMsgBatchSize(int size) throws JMSException;

Sets the message batch size.

Parameters
Exceptions

setMsgCompList

public void setMsgCompList(Collection compList) throws JMSException;

Sets the list of message compression techniques.

Parameters
Exceptions

setMulticast

public void setMulticast(int multicast) throws JMSException;

Sets the value of the multicast attribute.

Parameters
Exceptions

setOptimisticPublication

public void setOptimisticPublication(boolean newVal) throws JMSException;

Determines whether the publish/subscribe MessageProducers can return immediately from a send/publish call rather than wait until the message has completed delivery. If false, failure to deliver the message will only be reported when the message is committed.

Parameters
Exceptions

setOutcomeNotification

public void setOutcomeNotification(boolean newVal) throws JMSException;

Determines whether publish/subscribe MessageConsumers are informed of the outcome of acknowledge or commit calls after receiving messages.

Parameters

setPollingInterval

public void setPollingInterval(int interval) throws JMSException;

Sets the interval between scans of all receivers during asynchronous message delivery.

Parameters
Exceptions

setPort

public void setPort(int port) throws JMSException;

Sets the port for a client connection.

Parameters
Exceptions

setProcessDuration

public void setProcessDuration(int newVal) throws JMSException;

Sets how promptly received messages are processed. While this alone does not make any difference, quickly processing messages is a prerequisite for viewing uncommitted messages.

Parameters

setProxyHostName

public void setProxyHostName(String hostName) throws JMSException;

Sets the proxy host name.

Parameters
Exceptions

setProxyPort

public void setProxyPort(int proxyPort) throws JMSException;

Sets the proxy port attribute.

Parameters
Exceptions

setPubAckInterval

public void setPubAckInterval(int interval) throws JMSException;

Sets the number of messages that can be published before requiring acknowledgement from the broker. Applications do not normally alter this value, and must not rely on this acknowledgement.

Parameters
Exceptions

setQueueManager

public void setQueueManager(String queueManagerName) throws JMSException;

Sets the name of the queue manager.

Parameters
Exceptions

setReceiveExit

public void setReceiveExit(String receiveExit);

Sets the receive exit. When writing exits for use with WebSphere MQ Java, each object must also have a constructor that takes a single string argument. When WebSphere MQ creates an instance of the exit, it will pass any initialization data into the exit using this constructor.

Parameters

setReceiveExitInit

public void setReceiveExitInit(String data);

Sets the initialization string for the receive exit.

Parameters

setReceiveIsolation

public void setReceiveIsolation(int newVal) throws JMSException;

Sets whether calls by MessageConsumers are isolated from other operations.

Parameters
Exceptions

setRescanInterval

public void setRescanInterval(int interval) throws JMSException;

Sets the interval between browsing a queue. The scan looks for messages that were not returned by the previous scan.

Parameters

setSecurityExit

public void setSecurityExit(String securityExit);

Sets the security exit. When writing exits for use with WebSphere MQ Java, each object must also have a constructor that takes a single string argument. When WebSphere MQ creates an instance of the exit, it will pass any initialization data into the exit using this constructor.

Parameters

setSecurityExitInit

public void setSecurityExitInit(String data);

Sets the initialization string for the security exit.

Parameters

setSendExit

public void setSendExit(String sendExit);

Sets the send exit. When writing exits for use with WebSphere MQ Java, each object must also have a constructor that takes a single string argument. When WebSphere MQ creates an instance of the exit, it will pass any initialization data into the exit using this constructor.

Parameters

setSendExitInit

public void setSendExitInit(String data);

Gets the description of the send exit.

Parameters

setSparseSubscriptions

public void setSparseSubscriptions(boolean sparse) throws JMSException;

Sets whether sparse subscriptions are selected. A sparse subscription is one that receives infrequent matching messages.

Parameters
Exceptions

setSSLCertStores

public void setSSLCertStores(Collection stores);

Provides a collection of CertStore objects used for certificate revocation list (CRL) checking. The certificate provided by the queue manager is checked against one of the CertStore objects contained within the collection; if the certificate is found, the connection attempt fails. At connect-time, each CertStore in the collection is tried in turn until one is successfully used to verify the queue manager's certificate. This property is ignored if sslCipherSuite is null. Use of this property requires Java 2 v1.4. If CertStore objects are specified using this method the MQConnectionFactory cannot be bound into a JNDI namespace. Attempting to do so will result in an exception being thrown.

You must make sure that your Java Software Development Kit (SDK) is compatible with the CRL to use CertStore successfully with a CRL hosted on an LDAP server. Some SDKs require that the CRL conforms to RFC 2587, which defines a schema for LDAP v2. Most LDAP v3 servers use RFC 2256 instead.

Parameters

setSSLCertStores

public void setSSLCertStores(String stores) throws JMSException;

Specifies a list of LDAP servers used for certificate revocation list (CRL) checking. It allows the user to specify the URIs of LDAP CertStore objects as a String, which is converted internally to the Collection form as required by the CertStore checking routines. This method is provided to support storing the CertStore list via JMSAdmin. Each LDAP server is tried in turn until one is successfully used to verify the queue manager's certificate.

Parameters
Exceptions

setSSLCipherSuite

public void setSSLCipherSuite(String cipherSuite);

Sets the CipherSuite used for SSL encryption. Set this to the CipherSuite matching the CipherSpec set on the SVRCONN channel.

Parameters

setSSLFipsRequired

public void setSSLFipsRequired(boolean required);

Sets whether sslFips (FIPS) is required.

Parameters

setSSLPeerName

public void setSSLPeerName(String peerName) throws JMSException;

Sets a distinguished name (DN) pattern. If sslCipherSuite is set, this pattern can ensure that the correct queue manager is used. The connection attempt fails if the distinguished name provided by the queue manager does not match this pattern.

Parameters
Exceptions

setSSLResetCount

public void setSSLResetCount(int bytes) throws JMSException;

Sets the SSL reset count.

Parameters
Exceptions

setSSLSocketFactory

public void setSSLSocketFactory(Object sf);

Sets the SSLSocketFactory for use with SSL encryption. Use this to customize all aspects of SSL encryption. Refer to your JSSE provider's documentation for more information on constructing and customizing SSLSocketFactory instances. If a custom SSLSocketFactory is specified, the MQConnectionFactory cannot be bound into a JNDI namespace. Attempting to do so results in an exception.

Parameters

setStatusRefreshInterval

public void setStatusRefreshInterval(int interval) throws JMSException;

Sets the status refresh interval.

Parameters
Exceptions

setSubscriptionStore

public void setSubscriptionStore(int flag) throws JMSException;

Sets the SUBSTORE property.

Parameters
Exceptions

setSyncpointAllGets

public void setSyncpointAllGets(boolean flag);

Chooses whether to do all GET operations within a syncpoint. The default setting for this property is false.

Parameters

setTargetClientMatching

public void setTargetClientMatching(boolean matchClient);

Enable or disable target client matching. If this is set to true, then only MQMD messages (those from a non-JMS application) containing a replyTo will have a JMS replyTo Destination constructed with targetClient set to JMSC.MQJMS_CLIENT_NONJMS_MQ. This ensures that the reply can be understood by the originator.

If this field is set to false, then replies will always contain an RFH2 header, even though the receiver might not understand the reply.

Note that this applies only to point-to-point destinations. This field is set to true by default.

setTemporaryModel

public void setTemporaryModel(String queueName) throws JMSException;

Sets the name of a model queue for creating temporary destinations.

Parameters
Exceptions

setTempQPrefix

public void setTempQPrefix(String newTempQPrefix) throws JMSException;

Sets the prefix to be used to form the name of a WebSphere MQ dynamic queue.

Parameters
Exceptions

setTransportType

public void setTransportType(int type) throws JMSException;

Sets the transport type.

Parameters
Exceptions

setUseConnectionPooling

public void setUseConnectionPooling(boolean usePooling);

Chooses whether to use connection pooling. If you set this to true, JMS enables connection pooling for the lifetime of any connections created through the ConnectionFactory. This also affects connections created with usePooling set to false; to disable connection pooling throughout a JVM, ensure that all ConnectionFactories used within the JVM have usePooling set to false.

Parameters