All Packages Class Hierarchy This Package Previous Next Index
Class bea.jolt.pool.SessionPoolManager
java.lang.Object
|
+----java.util.Dictionary
|
+----java.util.Hashtable
|
+----bea.jolt.pool.SessionPoolManager
- public class SessionPoolManager
- extends Hashtable
This class manages a collection of one or more session pools.
It provides 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 the 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:
- Create a SessionPoolManager and store a reference to it.
This would usually be done when the application is started.
- Create one or more session pools in the SessionPoolManager. This
would also normally be done when the application is started.
- Start receiving client requests (HTTP POST or GET requests)
- For each client request that is received
- Locate the SessionPoolManager
- Locate a session pool from the SessionPoolManager (using its name)
- Submit a service call on the session pool, and get the result
- Send a response back to the client
- The servlet application is shut down.
- Disconnect the session pools.
- Release the reference to the SessionPoolManager.
When session pools are used in a BEA WebLogic server, the start up and
shut down steps of the lifecycle are handled automatically by setting
administrative properties in the WebLogic system properties file.
There is generally no need to have more than one instance of a
SessionPoolManager per application.
- Author:
- Copyright (c) 1999 by BEA Systems, Inc. All Rights Reserved.
- See Also:
- POOLMANAGER_NAME
-
POOLMANAGER_NAME
- The JNDI entry name for the SessionPoolManager.
-
VERSION
-
-
SessionPoolManager()
- Creates a default SessionPoolManager object with
an initial capacity of 10.
-
createSession(String[], UserInfo, String)
- This method is part of the SessionPool administrative API.
-
createSessionPool(String[], String[], int, int, UserInfo, String)
- This method is part of the session pool administrative API.
-
done()
- This method is part of the session pool administrative API.
-
getSessionPool(String)
- Returns a named session pool.
-
removeSessionPool(String)
- This method is part of the session pool administrative API.
-
stopSessionPool(String)
- This method is part of the session pool administrative API.
-
suspendSessionPool(String, boolean)
- This method is part of the session pool administrative API.
POOLMANAGER_NAME
public static final String POOLMANAGER_NAME
- The JNDI entry name for the SessionPoolManager.
When session pools are being used with the BEA WebLogic Application Server,
the session pool manager is created at startup and is registered in
JNDI using this name.
The following code retrieves the session pool manager via JNDI:
SessionPoolManager mgr;
try
{
Context ctx = TengahInitialContextFactory.newInstance( new Environment() );
mgr = (SessionPoolManager) ctx.lookup(SessionPoolManager.POOLMANAGER_NAME);
}
catch (NamingException e)
{
// handle error
}
VERSION
public static final String VERSION
SessionPoolManager
public SessionPoolManager()
- Creates a default SessionPoolManager object with
an initial capacity of 10.
done
public final void done()
- This method is part of the session pool administrative API.
Causes all session pools in this
SessionPoolManager to be stopped immediately. Any in-process
requests in any session pools are terminated. Exceptions
are thrown for any outstanding or new requests.
- See Also:
- stopSessionPool, suspendSessionPool, removeSessionPool
createSessionPool
public final int createSessionPool(String addrs[],
String saddrs[],
int minCons,
int maxCons,
UserInfo usr,
String id)
- This method is part of the session pool administrative API.
It reates a pool of connections to a BEA TUXEDO system.
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.
- Parameters:
- addrs - List of primary server addresses
- saddrs - List of secondary server addresses for failover
- minCons - Minimum number of connections to start with
- maxCons - Maximum number of connections in this pool
- usr - BEA TUXEDO authentication information, or null
- id - ID to identify the session pool, or
null for default session pool
- Returns:
- Number of successful connections
- See Also:
- getSessionPool
createSession
public final int createSession(String addrs[],
UserInfo usr,
String id)
- This method is part of the SessionPool administrative API.
It creates a connection-oriented session to Jolt server with a
single connection. The session should be used exclusively by
a client. The session is dead if its connection is terminated.
The session manager automatically cleans up any dead sessions.
This method should not be documented.
- Parameters:
- addrs - List of server addresses
- usr - BEA TUXEDO authentication information, or null
- id - Unique client id specified by the caller
- Returns:
- 1 for successful connection, or 0.
suspendSessionPool
public final void suspendSessionPool(String id,
boolean action)
- This method is part of the session pool administrative API.
It suspends an active session pool, or resumes
a suspended session pool. When a session pool is suspended,
it is put in a mode where it does not accept any new requests.
Requests that have already been dispatched to the session pool
complete normally. When a session pool is resumed, it
is restored to a mode where it accepts new requests.
This method allows an administrator to
shut down a session pool gracefully. When there are no
outstanding requests in the session pool, the pool can be
stopped.
id identifies the session pool to suspend or resume.
It must match the id used in the createSessionPool method
to create the session pool.
- Parameters:
- id - ID to identify the session pool, or
null for default session pool
- action - True to suspend the session pool, false to
resume it.
- See Also:
- createSessionPool, stopSessionPool, removeSessionPool, done
stopSessionPool
public final void stopSessionPool(String id)
- This method is part of the session pool administrative API.
Stops the session pool immediately. All active connections
in the session pool are terminated. Any in-process
requests in the session pool are terminated. Exceptions
are thrown for outstanding or new requests.
id identifies the session pool to stop.
It must match the id used in the createSessionPool method
to create the session pool.
- Parameters:
- id - ID to identify the session pool, or null for
default session pool
- See Also:
- createSessionPool, suspendSessionPool, removeSessionPool, done
removeSessionPool
public final void removeSessionPool(String id)
- This method is part of the session pool administrative API.
It shuts down the session pool and removes it from the
SessionPoolManager. All active connections in
this session pool are terminated immediately. Any in-process
requests in the session pool are terminated. Exceptions
are thrown for outstanding or new requests.
id identifies the session pool to remove.
It must match the id used in the createSessionPool method
to create the session pool.
- Parameters:
- id - ID to identify the session pool, or null for
default session pool
- See Also:
- createSessionPool, suspendSessionPool, stopSessionPool, done
getSessionPool
public final SessionPool getSessionPool(String id)
- Returns a named session pool.
ID identifies the session pool to return.
It must match the id used in the createSessionPool method
to create the session pool. If id does not match the
name of a session pool, this method returns null.
Refer to the BEA WebLogic Administrators Guide
for information on creating and naming
a SessionPool.
- Parameters:
- id - ID that identifies the session pool, or null
for the default session pool
- Returns:
- A SessionPool or null
- See Also:
- createSessionPool
All Packages Class Hierarchy This Package Previous Next Index