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