public final class MQSimpleConnectionManager
extends com.ibm.mq.jmqi.JmqiObject
| Modifier and Type | Field and Description |
|---|---|
static int |
MODE_ACTIVE
The pool is always active.
|
static int |
MODE_AUTO
An MQSimpleConnectionManager is active if it is the default connection manager and there is at
least one connection in the pool.
|
static int |
MODE_INACTIVE
The pool is always inactive.
|
| Constructor and Description |
|---|
MQSimpleConnectionManager()
Constructs an MQSimpleConnectionManager.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
allocateConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
Makes a connection to a queue manager, either by reusing an existing connection or by creating
a new one.
|
java.lang.Object |
createConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
Makes a connection to a queue manager.
|
int |
getActive()
Gets the active mode of the pool.
|
int |
getHighThreshold()
Deprecated.
use
getMaxUnusedConnections()instead. |
int |
getMaxConnections()
Gets the maximum number of connections.
|
int |
getMaxUnusedConnections()
Gets the maximum number of unused connections in the pool.
|
long |
getTimeout()
Gets the timeout value.
|
java.lang.Object |
recycleConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
Finds an existing connection to a queue manager.
|
void |
setActive(int mode)
Sets the active mode of the pool.
|
void |
setHighThreshold(int limit)
Deprecated.
use
setMaxUnusedConnections() instead. |
void |
setMaxConnections(int newLimit)
Sets the maximum number of connections.
|
void |
setMaxUnusedConnections(int limit)
Sets the maximum number of unused connections in the pool.
|
void |
setTimeout(long timeout)
Sets the timeout value.
|
public static final int MODE_AUTO
This is the default mode.
public static final int MODE_ACTIVE
MQQueueManager.disconnect(),
the underlying connection is pooled and can be reused the next time an MQQueueManager object is
constructed. Connections are destroyed by a separate thread if they have been unused for longer
then the timeout period or if the size of the pool exceeds the value set by
setMaxUnusedConnections().public static final int MODE_INACTIVE
MQQueueManager.disconnect()is called.public MQSimpleConnectionManager()
public java.lang.Object allocateConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
throws com.ibm.mq.MQResourceException
Normal applications must not call this method.
mcf - the connection factory.cxRequestInfo - represents information specific to the resource adapter for handling the
connection request.MQResourceException - if the call fails.public java.lang.Object recycleConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
Normal applications must not call this method.
mcf - the connection factory.cxRequestInfo - represents information specific to the resource adapter for handling the
connection request.public java.lang.Object createConnection(com.ibm.mq.MQManagedConnectionFactory mcf,
com.ibm.mq.MQConnectionRequestInfo cxRequestInfo)
throws com.ibm.mq.MQResourceException
Normal applications must not call this method.
mcf - the connection factory.cxRequestInfo - represents information specific to the resource adapter for handling the
connection request.MQResourceException - if the call fails.public void setActive(int mode)
mode - one of:
public int getActive()
public void setTimeout(long timeout)
timeout - the time out value in milliseconds. Connections which have been unused for this
length of time are destroyed.public long getTimeout()
public void setMaxUnusedConnections(int limit)
limit - recently used connections are destroyed if the size of the pool exceeds this
value.public void setHighThreshold(int limit)
setMaxUnusedConnections() instead.limit - The value to setpublic int getMaxUnusedConnections()
public int getHighThreshold()
getMaxUnusedConnections()instead.public void setMaxConnections(int newLimit)
throws java.lang.IllegalArgumentException
newLimit - the new maximum number of connections.java.lang.IllegalArgumentException - If limit specified is illegalpublic int getMaxConnections()