BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Using BEA Jolt with BEA WebLogic Server   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


Configuring a Session Pool

You can access session pools through the SessionPoolManager class. WebLogic Server uses a variation of the session pool called a servlet session pool. The servlet session pool provides extra functionality that is convenient for use inside an HTTP servlet.

When you configure a servlet session pool through the WebLogic Administration Console, the following information is added to the config.xml configuration file:

<StartupClass
ClassName="bea.jolt.pool.servlet.weblogic.PoolManagerStartUp"
FailureIsFatal="false"
Name="MyStartup Class"
Targets="myserver"
/>
<JoltConnectionPool
ApplicationPassword="tuxedo"
MaximumPoolSize="5"
MinimumPoolSize="3"
Name="MyJolt Connection Pool"
PrimaryAddresses="//TUXSERVER:6309"
RecvTimeout="300"
SecurityContextEnabled="true"
Targets="myserver"
UserName="joltuser"
UserPassword="jolttest"
UserRole="clt"
/>

When WebLogic is started (or restarted), it invokes the PoolManagerStartUp class and its associated startupArgs. On the first invocation, the PoolManagerStartUp class creates a ServletSessionPoolManager object, which contains every ServletSessionPool configured in the config.xml configuration file.

Subsequent calls add another ServletSessionPool to the same ServletSessionPoolManager. You must add an entry for each session pool, using a unique virtual name binding for each, as shown in the preceding example. The WebLogic Server creates a new ServletSessionPool as defined in the config.xml file.

For additional information about property settings and a list of definitions, see Jolt Startup Class and Connection Pool.

Accessing a Servlet Session Pool

Once a WebLogic Server is configured to set up a Jolt session pool on startup, you can access and use the Jolt session pool from your Java application or servlet. As described earlier, in the WebLogic Server all ServletSessionPool objects are managed by the same ServletSessionPoolManager.

  ServletSessionPoolManager poolMgr = (ServletSessionPoolManager) 
    SessionPoolManager.poolmanager;

The WebLogic Server uses a ServletSessionPoolManager class that is derived from SessionPoolManager. The ServletSessionPoolManager manages ServletSessionPool objects, which offer additional HTTP servlet methods.

SessionPoolManager provides several methods for managing the administration of a session pool. In the following example, the SessionPoolManager is used to retrieve the SessionPool that has been named joltpoolname:

  SessionPool sPool = poolMgr.getSessionPool("joltpoolname");

However, because the WebLogic Server uses the subclass ServletSessionPoolManager, the above example actually returns a ServletSessionPool object in the guise of a SessionPool.

You must cast the SessionPool to a ServletSessionPool, as in the following code example:

  ServletSessionPool ssPool =
    (ServletSessionPool) poolMgr.getSessionPool("joltpoolname");

Because WebLogic Server creates and configures the ServletSessionPoolManager, it is likely that this is the only method you will use. Other SessionPoolManager methods allow you to create, suspend, stop, or shut down individual or all the session pools it manages. We recommend that you leave these administrative operations to the WebLogic Server by configuring and managing your session pools using the WebLogic config.xml configuration file.

 

back to top previous page next page