com.ibm.mq
Class MQEnvironment
- java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.MQEnvironment
- public class MQEnvironment
- extends com.ibm.mq.jmqi.JmqiObject
Note: All the methods and attributes of this class apply to the WebSphere MQ classes for Java client connections, but only enableTracing(), disableTracing(), properties, version_notice, userID, connOptions and connTag apply to bindings connections.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
|
ccdtUrlProperty
A URL specifying the location of a Client Channel Definition Table (CCDT) to define the
connection properties.
|
|
CCSID
The CCSID used by the client.
|
|
channel
The name of the channel to connect to on the target queue manager.
|
|
channelReceiveExit
The receive exit used when receiving messages from a queue manager.
|
|
channelReceiveExitUserData
|
|
channelSecurityExit
The security exit used when connecting to a queue manager.
|
|
channelSecurityExitUserData
|
|
channelSendExit
The send exit used when sending messages to a queue manager.
|
|
channelSendExitUserData
|
|
connOptions
The queue manager connection options.
|
|
connTag
The connection tag which allows users to serialize access to the resources they are using on a
z/OS queue manager.
|
|
exitClasspath
When defining Java security, send or receive exit as strings to be loaded by the class loader,
the path that has the class or jar that contains the class has to be known to the loader.
|
|
hdrCompList
The list of supported compressors for header compression.
|
|
hostname
The TCP/IP hostname of the machine on which the WebSphere MQ server resides.
|
|
localAddressSetting
The local address, including a range of ports, used when connecting to a WebSphere MQ queue
manager through a firewall.
|
|
msgCompList
The list of supported compressors for message compression.
|
|
password
The password used to verify the identity of the WebSphere MQ Client.
|
|
port
The port to be used.
|
|
properties
A Hashtable which defines the WebSphere MQ environment.
|
|
receiveExit
Deprecated. The receive exit used when receiving messages from a queue manager. It allows you
to examine, and possibly alter, data and is normally used in conjunction with a
corresponding send exit at the queue manager.
If you want to provide your own receive exit, define a class that implements the MQReceiveExit interface, and assign receiveExit to an instance of that class. If you set this field to null no receive exit is called. |
|
receiveExitUserData
Deprecated.
|
|
securityExit
Deprecated. The security exit used when connecting to a queue manager. It allows you to
customise the security flows that occur when an attempt is made to connect to a
queue manager.
If you want to provide your own security exit, define a class that implements the MQSecurityExit interface and assign securityExit to an instance of that class. If you set this field to null no security exit is called. |
|
securityExitUserData
Deprecated.
|
|
sendExit
Deprecated. The send exit used when sending messages to a queue manager. It allows you to
examine, and possibly alter, data and is normally used in conjunction with a
corresponding receive exit at the queue manager.
If you want to provide your own send exit, define a class that implements the MQSendExit interface, and assign sendExit to an instance of that class. If you set this field to null no send exit is called. |
|
sendExitUserData
Deprecated.
|
|
sharingConversations
The number of conversations per connection.
|
|
sslCertStores
Collection of SSL CertStores.
|
|
sslCipherSuite
The name of the Cipher Suite to be used by SSL.
|
|
sslFipsRequired
When this is set to true, the only Cipher Suites that can be used on an SSL connection from
this client process are those which are FIPS-enabled.
|
|
sslPeerName
The Distinguished Name (DN) of the queue manager to be used by SSL.
|
|
sslResetCount
The total number of unencrypted bytes that are sent and received by the initiating channel MCA
before the secret key is reset.
|
|
sslSocketFactory
The factory to use when connecting with SSL encryption.
|
|
userID
The ID used to identify the WebSphere MQ client.
|
|
version_notice
The current version of the Websphere MQ Java Classes.
|
| Fields inherited from class com.ibm.mq.jmqi.JmqiObject |
|---|
COMP_JM, COMP_JN, COMP_JO |
Constructor Summary
| Constructor and Description |
|---|
MQEnvironment()
Constructor
|
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
addConnectionPoolToken()
Constructs an MQPoolToken and adds it to the set of tokens.
|
|
addConnectionPoolToken(MQPoolToken token)
Adds a given MQPoolToken to the connection pool.
|
|
disableTracing()
This method turns off the WebSphere MQ Client for Java trace facility.
|
|
enableTracing(int level)
|
|
enableTracing(int level,java.io.OutputStream stream)
Turns on tracing to console & (default) file
|
|
getDefaultConnectionManager()
Gets the default ConnectionManager.
|
|
getQueueManagerReference(int scope)
Returns an
MQQueueManagerobject reference if one is available within
the specified scope.
|
|
getQueueManagerReference(int scope,java.lang.Object context)
Returns an
MQQueueManagerobject reference if one is available within
the specified scope.
|
|
getVersionNotice()
Gets the current version of the Websphere MQ Java Classes.
|
|
removeConnectionPoolToken(MQPoolToken token)
Removes a token from the connection pool.
|
|
setDefaultConnectionManager(javax.resource.spi.ConnectionManager cxMan)
Sets the default ConnectionManager, and empties the set of MQPoolTokens.
|
|
setDefaultConnectionManager(com.ibm.mq.MQConnectionManager mqCxMan)
Sets the default MQConnectionManager, and empties the set of MQPoolTokens.
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
version_notice
- public static final java.lang.String version_notice
securityExit
- public static MQSecurityExit securityExit
If you want to provide your own security exit, define a class that implements the MQSecurityExit interface and assign securityExit to an instance of that class.
If you set this field to null no security exit is called.
securityExitUserData
- public static java.lang.String securityExitUserData
channelSecurityExit
- public static java.lang.Object channelSecurityExit
If you want to provide your own security exit, define a class that implements either:- MQSecurityExit, WMQSecurityExit interface or String and assign securityExit to an instance of that class or the class definition to the string.
If you set this field to null no security exit is called.
channelSecurityExitUserData
- public static java.lang.String channelSecurityExitUserData
sendExit
- public static MQSendExit sendExit
If you want to provide your own send exit, define a class that implements the MQSendExit interface, and assign sendExit to an instance of that class.
If you set this field to null no send exit is called.
sendExitUserData
- public static java.lang.String sendExitUserData
channelSendExit
- public static java.lang.Object channelSendExit
If you want to provide your own send exit, define a class that implements either:- MQSendExit, WMQSendExit interface or List or String and assign sendExit to an instance of that class or the class definition to the string.
If you set this field to null no send exit is called.
channelSendExitUserData
- public static java.lang.String channelSendExitUserData
receiveExit
- public static MQReceiveExit receiveExit
If you want to provide your own receive exit, define a class that implements the MQReceiveExit interface, and assign receiveExit to an instance of that class.
If you set this field to null no receive exit is called.
receiveExitUserData
- public static java.lang.String receiveExitUserData
channelReceiveExit
- public static java.lang.Object channelReceiveExit
If you want to provide your own send exit, define a class that implements either:- MQReceiveExit, WMQReceiveExit interface or List ro String and assign receiveExit to an instance of that class or the class definition to the string.
If you set this field to null no receive exit is called.
channelReceiveExitUserData
- public static java.lang.String channelReceiveExitUserData
exitClasspath
- public static java.lang.String exitClasspath
hostname
- public static java.lang.String hostname
port
- public static int port
The default value is 1414.
channel
- public static java.lang.String channel
userID
- public static java.lang.String userID
The default value is "" (the empty string).
If no security exit is defined for this client and userID is set to "" (the empty string), the WebSphere MQ classes for Java will query the Java System Property "user.name" and transmit this to the server.
If no security exit is defined for this client and userID has been set to a value other than "" (the empty string), then this value will be transmitted to the server.
If a security exit is defined for this client, then it is the responsibility of the exit to apply any application specific security logic. The value of userID is not made available to the exit and is not transmitted to the server.
password
- public static java.lang.String password
If a security exit is not defined for this client, the value of password is transmitted to the server and is available to the server security exit when it is invoked.
The default value is "" (empty string).
ccdtUrlProperty
- public static java.net.URL ccdtUrlProperty
CCSID
- public static int CCSID
Changing this value affects the way that the queue manager you connect to translates
information in the WebSphere MQ headers. All data in WebSphere MQ headers is drawn from the
invariant part of the ASCII codeset, except for the data in the
MQMessage.applicationIdDataand
MQMessage.putApplicationNamefields.
If you avoid using characters from the variant part of the ASCII codeset for these two fields, then the CCSID can be changed from 819 to any other ASCII codeset.
If you change the client CCSID to be the same as that of the queue manager to which you are connecting, you gain a performance benefit at the queue manager because it does not attempt to translate the message headers. For the reasons outlined above, this only applies to ASCII codesets - you must not set the CCSID to an EBCDIC-based value when communicating with a queue manager using EBCDIC.
The default value is 819.
hdrCompList
- public static java.util.Collection hdrCompList
msgCompList
- public static java.util.Collection msgCompList
sslCipherSuite
- public static java.lang.String sslCipherSuite
sslPeerName
- public static java.lang.String sslPeerName
sslCertStores
- public static java.util.Collection sslCertStores
sslSocketFactory
- public static java.lang.Object sslSocketFactory
For more information on constructing and customizing SSLSocketFactory instances, refer to your JSSE provider.
If set to null (default) and SSL encryption is requested, the default SSLSocketFactory is used.
This variable is ignored if sslCipherSuiteis null.
sslResetCount
- public static int sslResetCount
sslFipsRequired
- public static boolean sslFipsRequired
localAddressSetting
- public static java.lang.String localAddressSetting
[ip-addr][(low-port[,high-port])].
Here are some examples:
- 9.20.4.98
- The channel binds to address 9.20.4.98 locally
- 9.20.4.98(1000)
- The channel binds to address 9.20.4.98 locally and uses port 1000
- 9.20.4.98(1000,2000)
- The channel binds to address 9.20.4.98 locally and uses a port in the range 1000 to 2000
- (1000)
- The channel binds to port 1000 locally
- (1000,2000)
- The channel binds to a port in the range 1000 to 2000 locally
You can specify a host name instead of an IP address. The variable is initialized from system property com.ibm.mq.localAddress when you start the JVM. The default value is null.
connTag
- public static byte[] connTag
connOptionsis not set.
connOptions
- public static int connOptions
sharingConversations
- public static int sharingConversations
properties
- public static java.util.Hashtable properties
This Hashtable allows you to set environment properties as key/value pairs rather than as individual variables.
The properties can also be passed as a Hashtable in a parameter on the
MQQueueManagerconstructor. Properties passed on the constructor take
precedence over values set with this properties variable, but they are otherwise
interchangeable. The order of precedence of finding properties is:
- properties parameter on MQQueueManager constructor
- MQEnvironment.properties
- Other MQEnvironment variables
- Constant default values
The property key names are:
-
MQC.CCDT_URL_PROPERTY - overrides
ccdtUrlProperty. -
MQC.CCSID_PROPERTY - overrides
CCSID. -
MQC.CHANNEL_PROPERTY - overrides
channel. -
MQC.CONNECT_OPTIONS_PROPERTY - overrides
connOptions. -
MQC.CONNTAG_PROPERTY - overrides
connTag. -
MQC.HEADER_COMPRESSION_PROPERTY - overrides
hdrCompList. -
MQC.MESSAGE_COMPRESSION_PROPERTY - overrides
msgCompList. -
MQC.HOST_NAME_PROPERTY - overrides
hostname. -
MQC.LOCAL_ADDRESS_PROPERTY - overrides
localAddressSetting. -
MQC.PASSWORD_PROPERTY - overrides
password. -
MQC.PORT_PROPERTY - overrides
port. -
MQC.RECEIVE_EXIT_PROPERTY - overrides
receiveExit. -
MQC.SECURITY_EXIT_PROPERTY - overrides
securityExit. -
MQC.SEND_EXIT_PROPERTY - overrides
sendExit. -
MQC.SSL_CERT_STORE_PROPERTY - overrides
sslCertStores. -
MQC.SSL_CIPHER_SUITE_PROPERTY - overrides
sslCipherSuite. -
MQC.SSL_FIPS_REQUIRED - overrides
sslFipsRequired. -
MQC.SSL_RESET_COUNT_PROPERTY. - overrides
sslResetCount. -
MQC.SSL_PEER_NAME_PROPERTY. - overrides
sslPeerName. -
MQC.SSL_SOCKET_FACTORY_PROPERTY - overrides
sslSocketFactory. -
MQC.TRANSPORT_PROPERTY - forces
MQC.TRANSPORT_MQSERIES_BINDINGSorMQC.TRANSPORT_MQSERIES_CLIENT. -
MQC.USER_ID_PROPERTY - overrides
userID. -
MQC.SHARING_CONVERSATIONS_PROPERTY - overrides
sharingConversations.
Constructor Detail
MQEnvironment
- public MQEnvironment()
Method Detail
getVersionNotice
- public static final java.lang.String getVersionNotice( )
enableTracing
- public static void enableTracing( int level)
level - ignored at this version enableTracing
- public static void enableTracing( int level,
- java.io.OutputStream stream)
level - ignored at this version stream - ignored (unfortunately) at present disableTracing
- public static void disableTracing( )
setDefaultConnectionManager
- public static void setDefaultConnectionManager( com.ibm.mq.MQConnectionManager mqCxMan)
mqCxMan - the supplied MQConnectionManager. setDefaultConnectionManager
- public static void setDefaultConnectionManager( javax.resource.spi.ConnectionManager cxMan)
cxMan - the supplied ConnectionManager. getDefaultConnectionManager
- public static javax.resource.spi.ConnectionManager getDefaultConnectionManager( )
addConnectionPoolToken
- public static void addConnectionPoolToken( MQPoolToken token)
token - the token to be added. addConnectionPoolToken
- public static MQPoolToken addConnectionPoolToken( )
removeConnectionPoolToken()method.
removeConnectionPoolToken
- public static void removeConnectionPoolToken( MQPoolToken token)
token - the token to be removed. getQueueManagerReference
- public static MQQueueManager getQueueManagerReference( int scope)
MQQueueManagerobject reference if one is available within
the specified scope. The scope must be one of MQC.ASSOCIATE_ALLor
MQC.ASSOCIATE_THREAD, and a queue manager must already have been
created with MQC.MQ_QMGR_ASSOCIATION_PROPERTYset to
the scope requested.
If no queue manager has been created within the specified scope, or if
MQC.ASSOCIATE_NONEis specified, this method will return null.
A call to this method is the same as calling
MQEnvironment.getQueueManagerReference(int, Object) with a null Object.
scope - the association scope getQueueManagerReference
- public static MQQueueManager getQueueManagerReference( int scope,
- java.lang.Object context)
MQQueueManagerobject reference if one is available within
the specified scope. The scope must be one of MQC.ASSOCIATE_ALLor
MQC.ASSOCIATE_THREAD, and a queue manager must already have been
created with MQC.MQ_QMGR_ASSOCIATION_PROPERTYset 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_NONEis 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.
scope - the association scope context - an object containing context. Currently this must be a String specifying a
WebSphere MQ queue manager name