Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.http
Class SharedSessionCookieImpl

java.lang.Object
  extended byoracle.jbo.common.ampool.SessionCookieImpl
      extended byoracle.jbo.http.HttpSessionCookieImpl
          extended byoracle.jbo.http.SharedSessionCookieImpl
All Implemented Interfaces:
ApplicationModuleHandle, ApplicationModuleRef, oracle.jbo.http.BindingListener, HttpSessionCookie, java.io.Serializable, SessionCookie

Deprecated. since 9.0.5. Replaced by pool parameter: jbo.ampool.isuseexclusive

This class and its factory SharedSessionCookieFactory * have been deprecated. The new pool parametre jbo.ampool.isuseexclusive may instead be used to configure an ApplicationPool to share an ApplicationModule instance between SessionCookie(s). This change has enabled better use of the other pool tuning parameters for shared instances.

Please see the oracle.jbo.pool.ResourcePool.isUseExclusive() javadoc for more information regarding this new pool parameter.

public class SharedSessionCookieImpl
extends HttpSessionCookieImpl

A shared application module handle.

Some enterprise applications may define static data that is required across sessions and does not change very frequently. An example of this type of data might be application metadata that is used to render the application UI. If BC4J is used to access the static data then an unnecessary overhead is incurred if the static data caches are repopulated from the database for each application session on every request. In order to optimize performance common practice is to cache the shared static data for reuse across sessions and requests.

This class supports shared, static data caches by allowing requests from multiple sessions to share a single application module instance which is managed by an application pool for the lifetime of the web server VM.

The SharedSessionCookieImpl extends the HttpSessionCookieImpl with the following logic for managing access to a shared application module instance:

  • Prevents unnecessary state passivation at the end of a request
  • Manages shared, transactional application module state across sessions and requests
  • The SharedSessionCookieFactory may be used to instantiate SharedSessionCookieImpl sessions for an application pool. The application developer may use the SharedSessionCookieImpl with an application pool by specifying the following BC4J property in the configuration of the application module that will be used to cache static data:

    jbo.ampool.sessioncookiefactoryclass=oracle.jbo.http.SharedSessionCookieFactory

    After having declared the property above the application developer may access the shared application module instance with any application pooling client like the BC4J data tags and the BC4J data web beans.

    Finally, the application developer should be careful about mutating the shared transactional state after a shared session cookie has been used. Most shared state should be "built and cached" only once after an application module is created or connected and before it has become available for use. One recommended place to initialize shared ApplicationModule state is the prepareSession method which is invoked after an ApplicationModule has been connected and is also threadsafe.

    A session may use the locking mode when acquiring an ApplicationModule to synchronize access to the shared ApplicationModule instance. However, if locking is used extra care should be taken to ensure that the locking request releases the lock by including the useApplicationModule and releaseApplicationModule invocations in a try...finally block.

    Please see HttpSessionCookieImpl for more infomartion regarding the http session cookie implementation.

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class oracle.jbo.common.ampool.SessionCookieImpl
    mEnvironment
     
    Fields inherited from interface oracle.jbo.common.ampool.SessionCookie
    BUNDLED_EXC_MODE_KEY, FORCE_RELEASE_MODE, MANAGED_RELEASE_MODE, NULL_PASSIVATION_ID, REMOVE_RESOURCE, RESERVED_MANAGED_RELEASE_MODE, RESERVED_UNMANAGED_RELEASE_MODE, SHARED, SHARED_MANAGED_RELEASE_MODE, SHARED_RELEASE_MODE, SHARED_UNMANAGED_RELEASE_MODE, STATE_MANAGED, STATE_UNMANAGED, UNSHARED, VALUE_SINK_KEY
     
    Constructor Summary
    SharedSessionCookieImpl(java.lang.String applicationId, java.lang.String sessionId, ApplicationPool pool)
              Deprecated. This constructor may be used if the sessionId is already known.
     
    Method Summary
     boolean isFailoverEnabled()
              Deprecated. Indicates that session application module state should be persisted to secondary storage immediately upon a managed release.
     void releaseApplicationModule(int releaseFlags, long waitTimeout)
              Deprecated. Release an application module for reuse.
    protected  void removeFromPool()
              Deprecated.  
     
    Methods inherited from class oracle.jbo.http.HttpSessionCookieImpl
    afterApplicationModuleRelease, beforeApplicationModuleRelease, readValue, timeout, useApplicationModule, valueBound, valueUnbound, writeValue, writeValue
     
    Methods inherited from class oracle.jbo.common.ampool.SessionCookieImpl
    copyInto, equals, getApplicationId, getClientEnvironment, getClientEnvironment, getEnvConfigurationName, getEnvInfoProvider, getEnvironment, getEnvironment, getIgnorePiggyback, getLastUpdate, getMostRecentStackId, getPassivationId, getPoolSignature, getProperty, getReservedPassivationId, getSessionId, getSSOSubscriber, getSSOUserName, getSyncLock, getThreadRefCount, getUserData, getUserData, getValue, hashCode, isActivationRequired, isActivationRequired, isApplicationModuleReleased, isApplicationModuleReleasedByThread, isApplicationModuleReserved, isConnectionPoolingEnabled, isResetNonTransactionalState, parsePassivationId, parseSessionId, passivateState, releaseApplicationModule, releaseApplicationModule, releaseApplicationModule, removeUserData, reservePassivationId, reservePassivationId, resetState, resetStateInternal, setActivated, setActivationRequired, setEnvInfoProvider, setEnvironment, setEnvironment, setIgnorePiggyback, setMostRecentStackId, setPassivationId, setReferenceCounting, setReservedPassivationId, setSessionCookieListener, setSingleThreaded, setUserData, timeout, toString, useApplicationModule, useApplicationModule, wasActivated
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     
    Methods inherited from interface oracle.jbo.common.ampool.SessionCookie
    copyInto, equals, getApplicationId, getEnvConfigurationName, getEnvInfoProvider, getIgnorePiggyback, getLastUpdate, getMostRecentStackId, getPassivationId, getPoolSignature, getReservedPassivationId, getSessionId, getSSOSubscriber, getSSOUserName, getSyncLock, getThreadRefCount, getUserData, getValue, hashCode, isActivationRequired, isActivationRequired, isApplicationModuleReleased, isApplicationModuleReleasedByThread, isConnectionPoolingEnabled, isResetNonTransactionalState, passivateState, releaseApplicationModule, releaseApplicationModule, releaseApplicationModule, removeUserData, reservePassivationId, reservePassivationId, resetStateInternal, setActivated, setActivationRequired, setEnvInfoProvider, setEnvironment, setEnvironment, setIgnorePiggyback, setMostRecentStackId, setPassivationId, setReferenceCounting, setReservedPassivationId, setSessionCookieListener, setUserData, toString, wasActivated
     
    Methods inherited from interface oracle.jbo.common.ampool.ApplicationModuleRef
    isApplicationModuleReserved, resetState, useApplicationModule, useApplicationModule
     
    Methods inherited from interface oracle.jbo.ApplicationModuleHandle
    getClientEnvironment, getClientEnvironment, getEnvironment, getEnvironment, getUserData
     

    Constructor Detail

    SharedSessionCookieImpl

    public SharedSessionCookieImpl(java.lang.String applicationId,
                                   java.lang.String sessionId,
                                   ApplicationPool pool)
    Deprecated. 
    This constructor may be used if the sessionId is already known.

    Method Detail

    releaseApplicationModule

    public void releaseApplicationModule(int releaseFlags,
                                         long waitTimeout)
    Deprecated. 
    Description copied from interface: SessionCookie
    Release an application module for reuse.

    This method should be invoked at the end of each session request.

    If another thread is holding the lock associated with the session cookie then the current thread will wait for the period specified by the waitTimeout parameter. The current thread may be blocked upon invoking releaseApplicationModule if it did not acquire a session cookie lock when it dereferenced the application module with {@link #useApplicationModule(boolean).

    The SessionCookie supports the following release modes:

    SHARED_MANAGED_RELEASE_MODE: Release the ApplicationModule for re-use by other sessions. Manage this session's ApplicationModule state.

    SHARED_UNMANAGED_RELEASE_MODE: Release the ApplicationModule for re-use by other sessions. Do not manage this session's ApplicationModule state.

    RESERVED_UNMANAGED_RELEASE_MODE: Do not release the ApplicationModule for re-use by other sessions. Do not manage this session's ApplicationModule state. This mode would be used if failover is not required.

    RESERVED_MANAGED_RELEASE_MODE: Do not release the ApplicationModule for re-use by other sessions. Manage this session's ApplicationModule state. This mode would be used if failover is required for a reserved ApplicationModule instance.

    Specified by:
    releaseApplicationModule in interface SessionCookie
    Overrides:
    releaseApplicationModule in class SessionCookieImpl

    removeFromPool

    protected void removeFromPool()
    Deprecated. 
    Overrides:
    removeFromPool in class SessionCookieImpl

    isFailoverEnabled

    public boolean isFailoverEnabled()
    Deprecated. 
    Description copied from interface: SessionCookie
    Indicates that session application module state should be persisted to secondary storage immediately upon a managed release.

    Session cookie developers should be careful that this value not change after a session cookie has become active.

    Specified by:
    isFailoverEnabled in interface SessionCookie
    Overrides:
    isFailoverEnabled in class HttpSessionCookieImpl

    Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

     

    Copyright © 1997, 2004, Oracle. All rights reserved.