|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the ApplicationPool interface. It needs to be implemented by any
class that is intended to provide a customized pool interface. Look at
ApplicationPoolImpl for the default implementation.
View Implementation of ApplicationPool
View Implementation of ApplicationPoolImpl
Method Summary |
Type | Method |
---|---|
void |
addSessionCookie(SessionCookie cookie)
Add an existing session cookie to the pool. |
void |
checkin(ApplicationModule instance)
Deprecated. Replaced by ApplicationModuleRef.releaseApplicationModule(boolean,
boolean) .
Application developers should invoke SessionCookie.releaseApplicationModule(true, false)
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties) .
This change was necessary to support the SessionCookie interface. Please see
|
java.lang.String |
checkinWithSessionState(ApplicationModule appModule)
Deprecated. Replaced by ApplicationModuleRef.releaseApplicationModule(boolean,
boolean) .
Application developers should invoke SessionCookie.releaseApplicationModule(true, true)
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties) .
This change was necessary to support the SessionCookie interface. Please see
|
ApplicationModule |
checkout()
Deprecated. Replaced by ApplicationModuleRef.useApplicationModule() .
Application developers should invoke SessionCookie.useApplicationModule()
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties) .
This change was necessary to support the SessionCookie interface. Please see
|
ApplicationModule |
checkout(java.lang.String sessionId)
Deprecated. Replaced by ApplicationModuleRef.useApplicationModule() .
Application developers should invoke SessionCookie.useApplicationModule()
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties) .
This change was necessary to support the SessionCookie interface. Please see
|
void |
commitAndSyncCache(ApplicationModule instance)
Given an intitial Application Module instance, synchronizes the caches of all Application Module instances in the pool. |
ApplicationModule |
createNewInstance()
Deprecated. Replaced by ConnectionStrategy.createApplicationModule(SessionCookie,
EnvInfoProvider) .
All extending logic that was implemented here should be implemented in a
custom ConnectionStrategy class that extends DefaultConnectionStrategy . |
SessionCookie |
createSessionCookie(java.lang.String applicationId,
java.lang.String cookieValue,
java.util.Properties properties)
Create a session cookie for access to this pool. |
void |
dumpPoolStatistics(java.io.PrintWriter pw)
|
java.lang.String |
getApplicationModuleClass()
Return the class name of the application modules being managed by the pool. |
int |
getAvailableInstanceCount()
Returns the available number of instances in the Application Pool. |
int |
getAvailableNumPools()
Deprecated. Replaced by getAvailableInstanceCount() |
ConnectionStrategy |
getConnectionStrategy()
Get the application module strategy that will be used to create, connect, disconnect, and reconnect the application module. |
java.lang.String |
getConnectString()
Deprecated. This value should be passed to the pool connection strategy as SessionCookie environment or by implementing an EnvInfoProvider. Please see (@link oracle.jbo.common.ampool.DefaultConnectionStrategy} for more information. |
long |
getCreationTimeMillis(ApplicationModule instance)
Gets the time when the app module was created (in milli-secs). |
java.util.Hashtable |
getEnvironment()
Returns the Hashtable that was used to initialize the Context for the application module instances. |
int |
getInitPoolSize()
Get the initial number of application module instances which will be instantiated in the application pool. |
ApplicationModule |
getInstance(int index)
Deprecated. Implementation detail. This method has been made protected -- pool clients should not access pooled instances directly. |
int |
getInstanceCount()
Returns the number of instances that the Application Pool has created. |
int |
getMaxPoolSize()
Get the maximum number of application module instances which may be referenced by the application pool. |
java.lang.String |
getName()
Returns the pool's name. |
java.lang.String |
getPassword()
Deprecated. This value should be passed to the pool connection strategy as SessionCookie environment or by implementing an EnvInfoProvider. Please see (@link oracle.jbo.common.ampool.DefaultConnectionStrategy} for more information. |
java.lang.String |
getPoolName()
Deprecated. Replaced by #getName(). |
SessionCookieFactory |
getSessionCookieFactory()
Get the factory that will be used to create new session cookie instances. |
long |
getSignature()
Return a signature for the application pool. |
long |
getTimeToCreateMillis(ApplicationModule instance)
Gets the time that it will tke to create the application module (in milli-secs). |
java.util.Hashtable |
getUserData()
Returns the User Data hashtable. |
java.lang.String |
getUserName()
Deprecated. This value should be passed to the pool connection strategy as SessionCookie environment or by implementing an EnvInfoProvider. Please see (@link oracle.jbo.common.ampool.DefaultConnectionStrategy} for more information. |
void |
initialize(java.lang.String poolName,
java.lang.String applicationModule,
java.lang.String connectString,
java.util.Hashtable env)
This initializes the ApplicationPool. |
boolean |
isAvailable(ApplicationModule appModule)
Deprecated. Implementation detail. This method has been made protected. |
void |
releaseApplicationModule(SessionCookie cookie,
boolean manageState)
Mark the session's application module as available for reuse by other sessions. |
void |
releaseInstances()
Deprecated. Replaced by ResourcePool.removeResources() . Method
may be confused with releaseResource. |
java.lang.Object |
removeResource(java.lang.Object resource)
Remove the resource from the application pool. |
com.sun.java.util.collections.ArrayList |
removeResources()
Remove all of the pool application module instances that have been created so far. |
void |
removeSessionCookie(SessionCookie cookie)
Destroy a session cookie. |
void |
setAvailable(ApplicationModule appModule)
This method may be used by clients if they are manually populating the pool with application module instances using #createInstance to
notify the pool when a new instance is ready for use by other threads. |
void |
setAvailable(ApplicationModule appModule,
boolean available)
Deprecated. Implementation detail. Modifying an application module's available status could result in concurrency issues. setAvailable(ApplicationModule)
may be invoked to set an unused application module as available. |
void |
setConnectionStrategy(ConnectionStrategy strategy)
Set the application module strategy that will be used to create, connect, disconnect, and reconnect the application module. |
void |
setPassword(java.lang.String sPassword)
Deprecated. This value should be passed to the pool connection strategy as SessionCookie environment or by implementing an EnvInfoProvider. Please see (@link oracle.jbo.common.ampool.DefaultConnectionStrategy} for more information. |
void |
setSessionCookieFactory(SessionCookieFactory sessionCookieFactory)
Set the factory that will be used to create new session cookie instances. |
void |
setUserData(java.util.Hashtable data)
Replaces the userData with the new Hashtable. |
void |
setUserName(java.lang.String sUser)
Deprecated. This value should be passed to the pool connection strategy as SessionCookie environment or by implementing an EnvInfoProvider. Please see (@link oracle.jbo.common.ampool.DefaultConnectionStrategy} for more information. |
ApplicationModule |
useApplicationModule(SessionCookie cookie,
boolean checkout)
Returns an application module for the specified session cookie. |
boolean |
validateSessionCookie(SessionCookie cookie)
Validate that a session cookie is a valid handle for this pool. |
Method Detail |
public void initialize(java.lang.String poolName, java.lang.String applicationModule, java.lang.String connectString, java.util.Hashtable env)
poolName
- the name of the application module pool.applicationModule
- name of the application module for which the pool
will be created.connectString
- the connection string to use to connect to the
database.env
- name of the hash table containing the environment variables for
the selected platform.public java.lang.String getApplicationModuleClass()
public java.util.Hashtable getEnvironment()
public void setAvailable(ApplicationModule appModule)
#createInstance
to
notify the pool when a new instance is ready for use by other threads.
Pool clients should not use this method after an application module
has been set available for the first time.appModule
- the application module which will be made availablepublic ApplicationModule useApplicationModule(SessionCookie cookie, boolean checkout)
The requesting thread may obtain an application module with the state from a previous request by passing the previous request's cookie instance. The cookie should be used by the pool to re-create an application module state from a previous request.
If an "empty" session cookie is specified then the pool should return a
stateless application module instance. An empty session cookie is defined
as a cookie that does not reference a previous application module state.
Please see SessionCookie.getPassivationId()
for more information regarding application state maintenance.
In order to persist some internal state information, the application pool may mutate the specified cookie. Application pool clients should consequently be careful to reference the cookie value that is returned in the cookie value after checkout has been invoked.
cookie
- an empty/previous session cookiepublic void releaseApplicationModule(SessionCookie cookie, boolean manageState)
If the managed flag is true then the pool will maintain logical application module state while still sharing an application module resource between sessions.
When an application module is marked available with managed state the application module will be passivated immediately if failover support has been requested (default). If failover support has been disabled, through the jbo.DoFailover system parameter, the application module will not be passivated until it is re-used by a session other than the session releasing in the application module.
Please see SessionCookie
for more
information regarding session identification and application state
tracking.
cookie
- a session cookie equal to the session cookie that was
generated during checkoutmanageState
- indicates if the session's application module state
should be managed by the poolpublic com.sun.java.util.collections.ArrayList removeResources()
The remove() method is called on the Application Modules being represented by the application instance class
public java.lang.Object removeResource(java.lang.Object resource)
The remove() method is called on the Application Module being represented by the application instance class
public int getInstanceCount()
public int getAvailableInstanceCount()
public java.lang.String getName()
public java.util.Hashtable getUserData()
public void setUserData(java.util.Hashtable data)
the
- new hashtable to use for the environment information.public long getTimeToCreateMillis(ApplicationModule instance)
instance
- the application module instance for which you want to
know how long it will take to create it.public long getCreationTimeMillis(ApplicationModule instance)
instance
- the application module instance for which you want to
know the time of creation.public void commitAndSyncCache(ApplicationModule instance)
This method commits the transaction for instance. Then, it loops through all other instances of the Application Module in the pool and synchronizes their caches with the changes committed by instance. For example:
// Insert a new row row = voEmp1.createRow(); row.setAttribute("EmpNum", new Integer(9999)); row.setAttribute("EmpName", "NewPers"); row.setAttribute("EmpJob", "JOBX"); voEmp1.insertRow(row); // Commit the changes for the specified instance, then sync // them with the rest of the Application Module instances. pool1.commitAndSyncCache(am1);
instance
- an instance of an Application Module in the pool.public ConnectionStrategy getConnectionStrategy()
public void setConnectionStrategy(ConnectionStrategy strategy)
public SessionCookieFactory getSessionCookieFactory()
public void setSessionCookieFactory(SessionCookieFactory sessionCookieFactory)
public SessionCookie createSessionCookie(java.lang.String applicationId, java.lang.String cookieValue, java.util.Properties properties)
applicationId
- identifies the session applicationcookieValue
- a cookieValue from a previous requestproperties
- additional user properties. This parameter may be used
to pass application specific information to a session cookie factory.public void addSessionCookie(SessionCookie cookie)
createSessionCookie(String, String, Properties)
,
validateSessionCookie(SessionCookie)
public void removeSessionCookie(SessionCookie cookie)
public boolean validateSessionCookie(SessionCookie cookie)
getSignature()
public long getSignature()
The pool signature will also be used to determine whether a cookie is a valid handle to the pool instance. The pool signature value should be unique across pools and consistent across VMs.
#isValidSessionCookie(SessionCookie)
public void dumpPoolStatistics(java.io.PrintWriter pw)
public int getMaxPoolSize()
public int getInitPoolSize()
public boolean isAvailable(ApplicationModule appModule)
public java.lang.String getPoolName()
getName()
public ApplicationModule getInstance(int index)
public void setAvailable(ApplicationModule appModule, boolean available)
setAvailable(ApplicationModule)
may be invoked to set an unused application module as available.
#setAvailable(appModule)
public ApplicationModule createNewInstance() throws java.lang.Exception
ConnectionStrategy.createApplicationModule(SessionCookie,
EnvInfoProvider)
.
All extending logic that was implemented here should be implemented in a
custom ConnectionStrategy class that extends DefaultConnectionStrategy
.
ConnectionStrategy.createApplicationModule(SessionCookie,
EnvInfoProvider)
public int getAvailableNumPools()
getAvailableInstanceCount()
getAvailableInstanceCount()
public void checkin(ApplicationModule instance)
ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
.
Application developers should invoke SessionCookie.releaseApplicationModule(true, false)
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties)
.
This change was necessary to support the SessionCookie interface. Please see
SessionCookie
for more information about
using SessionCookies with the application pool.
instance
- name of the application module instance to check in.ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
,
ApplicationModuleRef.useApplicationModule()
public java.lang.String checkinWithSessionState(ApplicationModule appModule)
ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
.
Application developers should invoke SessionCookie.releaseApplicationModule(true, true)
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties)
.
This change was necessary to support the SessionCookie interface. Please see
SessionCookie
for more information about
using SessionCookies with the application pool.
This method should be used by pool clients that wish to maintain logical application module state while still sharing an application module resource across requests. The method returns a system generated session id for the check-in that should be used as the unique application module identifier by the client session.
The application module will be passivated immediately if failover support has been requested (default). If failover support has been disable, through the jbo.DoFailover system parameter, the application module will not be passivated until it is re-used by a session other than the session checking in the application module.
appModule
- the application module that will be checked in
ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
,
ApplicationModuleRef.useApplicationModule()
public ApplicationModule checkout() throws java.lang.Exception
ApplicationModuleRef.useApplicationModule()
.
Application developers should invoke SessionCookie.useApplicationModule()
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties)
.
This change was necessary to support the SessionCookie interface. Please see
SessionCookie
for more information about
using SessionCookies with the application pool.
ApplicationModuleRef.useApplicationModule()
,
ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
public ApplicationModule checkout(java.lang.String sessionId)
ApplicationModuleRef.useApplicationModule()
.
Application developers should invoke SessionCookie.useApplicationModule()
instead of this method. A session cookie instance may be acquired by invoking
createSessionCookie(String, String, Properties)
.
This change was necessary to support the SessionCookie interface. Please see
SessionCookie
for more information about
using SessionCookies with the application pool.
checkinWithSessionState(ApplicationModule)
against this application module pool.
The session id should be used to re-create an application module state from a previous request.
If an unrecognized session id is specified then the pool should return a stateless application module instance.
sessionId
- a session identifier from a previous requestApplicationModuleRef.useApplicationModule()
,
ApplicationModuleRef.releaseApplicationModule(boolean, boolean)
public java.lang.String getUserName()
ConnectionStrategy
,
EnvInfoProvider
,
SessionCookie
public void setUserName(java.lang.String sUser)
ConnectionStrategy
,
EnvInfoProvider
,
SessionCookie
public java.lang.String getPassword()
ConnectionStrategy
,
EnvInfoProvider
,
SessionCookie
public void setPassword(java.lang.String sPassword)
ConnectionStrategy
,
EnvInfoProvider
,
SessionCookie
public java.lang.String getConnectString()
ConnectionStrategy
,
EnvInfoProvider
,
SessionCookie
public void releaseInstances()
ResourcePool.removeResources()
. Method
may be confused with releaseResource.
ResourcePool.removeResources()
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |