public class PooledConnectionFactory extends Object implements javax.jms.ConnectionFactory
Modifier and Type | Field and Description |
---|---|
(package private) ConnectionFactory |
cf
The underlying ConnectionFactory
|
(package private) int |
maxFreeConnections
The maximum number of free connections for an identity in the pool.
|
(package private) ConnectionPool |
pool
The pool of connections
|
Constructor and Description |
---|
PooledConnectionFactory(javax.jms.ConnectionFactory cf)
Creates a new pool for the specified ConnectionFactory.
|
PooledConnectionFactory(javax.jms.ConnectionFactory cf,
int maxFreeConnections)
Creates a new pool for the specified ConnectionFactory.
|
Modifier and Type | Method and Description |
---|---|
javax.jms.Connection |
createConnection()
API method, creates a connection with the default user identity.
|
javax.jms.Connection |
createConnection(String name,
String password)
API method, creates a connection with the specified user identity.
|
protected ConnectionPool |
createConnectionPool(int maxFreeConnections) |
javax.jms.JMSContext |
createContext() |
javax.jms.JMSContext |
createContext(int sessionMode) |
javax.jms.JMSContext |
createContext(String userName,
String password) |
javax.jms.JMSContext |
createContext(String userName,
String password,
int sessionMode) |
(package private) void |
free(PooledConnection cnx) |
ConnectionFactory |
getConnectionFactory()
Returns the underlying ConnectionFactory used to create the connections.
|
int |
getMaxFreeConnections()
Returns the maximum number of free connections for an identity in the pool.
|
void |
setMaxFreeConnections(int maxFreeConnections)
Sets the maximum number of free connections for an identity in the pool.
|
ConnectionFactory cf
ConnectionPool pool
int maxFreeConnections
public PooledConnectionFactory(javax.jms.ConnectionFactory cf)
cf
- The ConnectionFactory used to really create the connections.public PooledConnectionFactory(javax.jms.ConnectionFactory cf, int maxFreeConnections)
cf
- The ConnectionFactory used to really create the connections.maxFreeConnections
- The maximum number of free connections for an identity in the pool.public ConnectionFactory getConnectionFactory()
public int getMaxFreeConnections()
public void setMaxFreeConnections(int maxFreeConnections)
maxFreeConnections
- the maximum number of free connections to setpublic javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSSecurityException
- If the default identification is incorrect.IllegalStateException
- If the server is not listening.javax.jms.JMSException
ConnectionFactory.createConnection()
public javax.jms.Connection createConnection(String name, String password) throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
name
- the caller's user name.password
- the caller's password.javax.jms.JMSSecurityException
- If the user identification is incorrect.IllegalStateException
- If the server is not listening.javax.jms.JMSException
ConnectionFactory.createConnection(String, String)
void free(PooledConnection cnx) throws javax.jms.JMSException
cnx
- javax.jms.JMSException
protected ConnectionPool createConnectionPool(int maxFreeConnections)
maxFreeConnections
- The maximum number of free connections for an identity in the pool.public javax.jms.JMSContext createContext()
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(String userName, String password)
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(String userName, String password, int sessionMode)
createContext
in interface javax.jms.ConnectionFactory
public javax.jms.JMSContext createContext(int sessionMode)
createContext
in interface javax.jms.ConnectionFactory
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.