|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--bea.jolt.pool.SessionPoolManager
This class manages a collection of one or more session pools. It provides some methods that are used to configure both the session pool manager and the session pools that it contains. These methods are part of the administrative API for a session pool. When session pools are being used with BEA WebLogic Application Server, configuration is done via the BEA WebLogic system properties file and the BEA WebLogic management console. A user does not need to access the adminstrative API directly. Refer to the BEA WebLogic Administrators Guide for information on configuring a session pool manager in a BEA WebLogic environment.
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.
POOLMANAGER_NAME
, Serialized FormField Summary | |
static java.lang.String |
POOLMANAGER_NAME
The JNDI entry name for the SessionPoolManager. |
Constructor Summary | |
SessionPoolManager()
Creates a default SessionPoolManager object with an initial capacity of 10. |
Method Summary | |
protected 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. |
void |
done()
This method is part of the session pool administrative API. |
SessionPool |
getSessionPool(java.lang.String id)
Returns a named session pool. |
protected void |
log(java.lang.String msg)
Logs an error message. |
protected SessionPool |
newSessionPool(java.lang.String[] addrs,
java.lang.String[] saddrs,
int minCons,
int maxCons,
UserInfo usr,
boolean keepAlive)
A default method to create the session. |
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. |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
get,
hashCode,
isEmpty,
keys,
keySet,
put,
putAll,
rehash,
remove,
size,
toString,
values |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String POOLMANAGER_NAME
The following code retrieves the session pool manager via JNDI:
SessionPoolManager mgr; try { Context ctx = (new Environment()).getInitialContext(); mgr = (SessionPoolManager) ctx.lookup(SessionPoolManager.POOLMANAGER_NAME); } catch (NamingException e) { // handle error }
Constructor Detail |
public SessionPoolManager()
Method Detail |
public final void done()
stopSessionPool(java.lang.String)
,
suspendSessionPool(java.lang.String, boolean)
,
removeSessionPool(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)
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)
protected 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 final 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)
protected SessionPool newSessionPool(java.lang.String[] addrs, java.lang.String[] saddrs, int minCons, int maxCons, UserInfo usr, boolean keepAlive)
addrs
- List server addressssaddrs
- List secondary server addresss for failoverminCons
- Minimum number of connectionsmaxCons
- Maximum number of connectionsusr
- User authentication information, or nullkeepAlive
- true for reconnection, false for no reconnection.protected void log(java.lang.String msg)
msg
- Error message to be logged.
|
Documentation is available at http://www.weblogic.com/docs51 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |