public class SessionPoolManager
extends java.util.Hashtable
The getSessionPool method is used to locate a session pool. This method is not part of the administrative API, it is used to submit a request to a BEA Tuxedo system.
A session pool is a set of connections to a BEA Tuxedo system. Each session pool is assigned a name when it is created; this name is used to identify each session pool in the SessionPoolManager. The SessionPoolManager allows one unnamed session pool to be created. This unnamed pool is assigned a default internal name, and can be accessed by using a null value for name. If there is only one session pool in the SessionPoolManager, this provides a convenient way to access it.
The following list shows a typical life-cycle of a SessionPoolManager:
There is generally no need to have more than one instance of a SessionPoolManager per application.
Modifier and Type | Field and Description |
---|---|
static SessionPoolManager |
poolmgr |
java.lang.String |
poolName
When session pools are being used with the BEA WebLogic Application Server,
the session pool manager is created at startup.
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
SessionPoolManager()
Creates a default SessionPoolManager object with
an initial capacity of 10.
|
Modifier and Type | Method and Description |
---|---|
int |
createSession(java.lang.String[] addrs,
UserInfo usr,
java.lang.String id)
This method is part of the SessionPool administrative API.
|
int |
createSessionPool(java.lang.String[] addrs,
java.lang.String[] saddrs,
int minCons,
int maxCons,
UserInfo usr,
java.lang.String id)
This method is part of the session pool administrative API.
|
int |
createSessionPool(java.lang.String[] addrs,
java.lang.String[] saddrs,
int minCons,
int maxCons,
UserInfo usr,
java.lang.String id,
boolean propagateSecurityCtxt,
SecurityContext SecurityContextClass)
This method is for internal use only.
|
void |
done()
This method is part of the session pool administrative API.
|
SessionPool |
getSessionPool(java.lang.String id)
Returns a named session pool.
|
void |
removeSessionPool(java.lang.String id)
This method is part of the session pool administrative API.
|
void |
stopSessionPool(java.lang.String id)
This method is part of the session pool administrative API.
|
void |
suspendSessionPool(java.lang.String id,
boolean action)
This method is part of the session pool administrative API.
|
public java.lang.String poolName
The following code retrieves the session pool manager:
SessionPoolManager mgr; try { mgr = SessionPoolManager.poolmgr; }
public static SessionPoolManager poolmgr
public static final java.lang.String VERSION
public SessionPoolManager()
public final void done()
public final int createSessionPool(java.lang.String[] addrs, java.lang.String[] saddrs, int minCons, int maxCons, UserInfo usr, java.lang.String id)
A session pool is a set of connections to a BEA Tuxedo system. The array addrs is a list of primary machine names and ports used to create the connections. The array saddrs is a list of secondary machine names and ports. If any connections to the primary machines fail, the session pool attempts to reconnect using the secondary list of addresses. The parameters minCons and maxCons represent the minimum and maximum number of connections to be established in the session pool. When the session pool is created, minCons connections are established. As load increases, the number of connections are increased up to maxCons. The usr parameter contains information such as the user name and the password that is used to connect to a BEA Tuxedo system. If no BEA Tuxedo authentication is required, this parameter should be null. The session pool is identified by id. If id is null, a default name is used to identify the session pool; to access this default session pool, always specify null as the id.
There can only be one session pool with a given name (including the default) at any time. Multiple calls to this method with the same id cause the existing session pool named id to be discarded by the session pool manager and replaced with a new session pool named id. The behavior of the original session pool is non-deterministic; the pool should not be used. All references to the original session pool should be discarded.
This method returns the number of successful connections. This should be the same as minCons.
addrs
- List of primary server addressessaddrs
- List of secondary server addresses for failoverminCons
- Minimum number of connections to start withmaxCons
- Maximum number of connections in this poolusr
- BEA Tuxedo authentication information, or nullid
- ID to identify the session pool, or
null for default session poolgetSessionPool(java.lang.String)
public final int createSessionPool(java.lang.String[] addrs, java.lang.String[] saddrs, int minCons, int maxCons, UserInfo usr, java.lang.String id, boolean propagateSecurityCtxt, SecurityContext SecurityContextClass)
public final int createSession(java.lang.String[] addrs, UserInfo usr, java.lang.String id)
This method should not be documented.
addrs
- List of server addressesusr
- BEA Tuxedo authentication information, or nullid
- Unique client id specified by the callerpublic final void suspendSessionPool(java.lang.String id, boolean action)
id
- ID to identify the session pool, or
null for default session poolaction
- True to suspend the session pool, false to
resume it.createSessionPool(java.lang.String[], java.lang.String[], int, int, bea.jolt.pool.UserInfo, java.lang.String)
,
stopSessionPool(java.lang.String)
,
removeSessionPool(java.lang.String)
,
done()
public final void stopSessionPool(java.lang.String id)
id
- ID to identify the session pool, or null for
default session poolcreateSessionPool(java.lang.String[], java.lang.String[], int, int, bea.jolt.pool.UserInfo, java.lang.String)
,
suspendSessionPool(java.lang.String, boolean)
,
removeSessionPool(java.lang.String)
,
done()
public final void removeSessionPool(java.lang.String id)
id
- ID to identify the session pool, or null for
default session poolcreateSessionPool(java.lang.String[], java.lang.String[], int, int, bea.jolt.pool.UserInfo, java.lang.String)
,
suspendSessionPool(java.lang.String, boolean)
,
stopSessionPool(java.lang.String)
,
done()
public SessionPool getSessionPool(java.lang.String id)
id
- ID that identifies the session pool, or null
for the default session poolcreateSessionPool(java.lang.String[], java.lang.String[], int, int, bea.jolt.pool.UserInfo, java.lang.String)