Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo.common.ampool
Interface SessionCookie

All Superinterfaces:
  ApplicationModuleHandle, ApplicationModuleRef, java.io.Serializable

All Known Subinterfaces:
  HttpSessionCookie

All Known Implementing Classes:
  HttpSessionCookieImpl, SessionCookieImpl

public interface SessionCookie
extends ApplicationModuleRef

Interface for session cookies. Session cookies are used by the client side BC4J frameworks to identify unique client sessions.

The session cookie is used to uniquely identify a client session across server requests and server instances. Examples of clients include web browsers and java applications.

Session cookie equality should be determined by the application and session identifiers of the cookie. Session identifiers should be unique across all client sessions. Session identifiers should also be consistent across web servers. These requirements are necessary to support consistent session identification across web server instances.

To illustrate the usages of the session and application identifiers consider a stateful web application that is load balanced across many servlet containers. Assume that two users are accessing this application from two different browsers. Further assume that the first http request from browser one is forwarded to web server one and that the first request from browser two is forwarded be web server two.

At this point each browser session has created application state that is maintained by their respective servers. The BC4J portions of these states are represented by two session cookie instances that have been created for the two client sessions on their respective servers. These session cookies will be stored in the server session context that has been created for each browser.

Now assume that the second request from browser one is forwarded to web server two. The server load balancing implementation may copy the session context, which should include the session cookie that was created by the first request, from web server one to web server two.

Now, if the session identifiers of the browser session cookies are equal then the second request from browser one may be identified as having originated from browser two and the request could "see" the state for browser two. Among other things, this could result in security leaks (imagine that I am using an online shopping application and am suddenly shown a page that contains the credit card information of another user).

In addition to the session identifier that is described above, the session cookie also supports an application identifier. Application identifers may be used to identify unique applications. To illustrate, assume that an online shopping application must support multiple shopping carts of the same type or class for each session. One shopping cart is used to store book orders while the other is used to store cd orders. Further, in order for the application to scale, assume that it is necessary to support both applications with the same pool of application modules. In order to maintain the two application states separately the application framework must be able to distinguish between the two session applications. The session cookie uses the application id to segment the session context for multiple applications.

Developers who are implementing their own session cookies should use both the application identifier and the session identifier in order to test equality between cookies.

Finally, a session cookie value is a string representation of session application state. Because this representation may be activated in different physical sessions (if the web server crashed between requests) the cookie value should contain both the session and the passivation identifiers of the cookie. The application id a good candidate for naming the cookie because it should be unique within a given session context.

Field Summary
`static java.lang.String` | `BUNDLED_EXC_MODE_KEY` A user data key which may be used to set the ApplicationModule txn bundled exception mode upon next use.
`static int` | `FORCE_RELEASE_MODE`
`static int` | `MANAGED_RELEASE_MODE`
`static int` | `NULL_PASSIVATION_ID`
`static int` | `REMOVE_RESOURCE`
`static int` | `RESERVED_MANAGED_RELEASE_MODE`
`static int` | `RESERVED_UNMANAGED_RELEASE_MODE`
`static boolean` | `SHARED`
`static int` | `SHARED_MANAGED_RELEASE_MODE`
`static int` | `SHARED_RELEASE_MODE`
`static int` | `SHARED_UNMANAGED_RELEASE_MODE`
`static boolean` | `STATE_MANAGED`
`static boolean` | `STATE_UNMANAGED`
`static boolean` | `UNSHARED`
`static java.lang.String` | `VALUE_SINK_KEY`

Method Summary
`void` | `copyInto(SessionCookie cookie)` Copies the state of this cookie into the target cookie.
`boolean` | `equals(java.lang.Object obj)`
`java.lang.String` | `getApplicationId()` Returns the application id for this session cookie.
`java.lang.String` | `getEnvConfigurationName()` Return the name of the BC4J configuration that was used to initialize the SessionCookie environment.
`EnvInfoProvider` | `getEnvInfoProvider()`
`boolean` | `getIgnorePiggyback()` INTERNAL USE ONLY.
`java.lang.Object` | `getInfoObject()` INTERNAL USE ONLY.
`java.util.Date` | `getLastUpdate()` Returns a date value indicating the last time the state of this cookie was updated.
`long` | `getLastUpdateLong()`
`ApplicationPoolSvcMsgContext` | `getMessageContext()` Returns the current message context for this cookie.
`int` | `getMostRecentStackId()` If the current thread holds an active ApplicationModule reference then this method will delegate to `ApplicationModule.getMostRecentStackId()`.
`int` | `getPassivationId()` Return an identifier for the last persisted session application state.
`long` | `getPoolSignature()` Returns the signature of the pool for which this session cookie is a handle.
`int` | `getReservedPassivationId()` Return the identifier that will be used to persist the session application state at the end of the request.
`java.lang.String` | `getSessionId()` Returns the session identifier.
`java.lang.String` | `getSSOSubscriber()`
`java.lang.String` | `getSSOUserName()`
`java.lang.Object` | `getSyncLock()` INTERNAL USE ONLY.
`int` | `getThreadRefCount()` INTERNAL USE ONLY.
`java.lang.Object` | `getUserData(java.lang.Object name)` Acquires the user data associated with the specified key from the SessionCookie user data map.
`java.lang.String` | `getValue()` Returns the session cookie value.
`int` | `hashCode()`
`boolean` | `isActivationRequired()` Deprecated. ApplicationDevelopers should instead override: `isActivationRequired(ApplicationModule)` This method will still be invoked from the new method.
`boolean` | `isActivationRequired(ApplicationModule context)` Indicates that state activation is required upon the next checkout for this session.
`boolean` | `isApplicationModuleReleased()` Determines if the ApplicationModule which is referenced by this session has been released to the ApplicationPool.
`boolean` | `isApplicationModuleReleasedByThread()` If the cookie is multi-threaded then this method will determine if the invoking thread has released the SessionCookie ApplicationModule.
`boolean` | `isConnectionPoolingEnabled()` Indicates that the session application module resource's JDBC connection should be released immediately upon release to the application pool.
`boolean` | `isFailoverEnabled()` Indicates that session application module state should be persisted to secondary storage immediately upon a managed release.
`boolean` | `isResetNonTransactionalState()` Indicates whether or not the non-transactional state of the session application module resource should be preserved upon an unmanaged release to the application pool.
`void` | `passivateState(java.lang.Object sink)` Passivates the session ApplicationModule state.
`java.lang.String` | `readValue(java.lang.Object source)` Read the cookie value to the specified data sink.
`void` | `releaseApplicationModule(boolean checkin, boolean manageState)` Deprecated. since 9.0.3 Use `releaseApplicationModule(int)` instead. Replace with the following flags for each checkin/manageState permutation: checkin=true, manageState=true: SHARED_MANAGED_RELEASE_MODE checkin=true, manageState=false: SHARED_UNMANAGED_RELEASE_MODE checkin=false, manageState=true: RESERVED_MANAGED_RELEASE_MODE checkin=false, manageState=false: RESERVED_UNMANAGED_RELEASE_MODE
`void` | `releaseApplicationModule(boolean checkin, boolean manageState, long waitTimeout)` Deprecated. since 9.0.3 use `releaseApplicationModule(int, long)` instead. Replace with the following flags each checkin/manageState permutation: checkin=true, manageState=true: SHARED_MANAGED_RELEASE_MODE checkin=true, manageState=false: SHARED_UNMANAGED_RELEASE_MODE checkin=false, manageState=true: RESERVED_MANAGED_RELEASE_MODE checkin=false, manageState=false: RESERVED_UNMANAGED_RELEASE_MODE
`void` | `releaseApplicationModule(int releaseFlags)` Release an application module for reuse.
`void` | `releaseApplicationModule(int releaseFlags, long waitTimeout)` Release an application module for reuse.
`java.lang.Object` | `removeUserData(java.lang.Object name)` Removes the user data associated with the specified key from the SessionCookie user data map.
`void` | `reservePassivationId()` Reserves a unique identifier for the session application.
`void` | `reservePassivationId(java.lang.Object sink)` Reserves a unique identifier for the session application.
`void` | `resetStateInternal()` INTERNAL USE ONLY.
`void` | `setActivated(boolean activated)` INTERNAL USE ONLY.
`void` | `setActivationRequired(boolean activateRequired)` May be used to force activation upon the next checkout for this session.
`void` | `setEnvInfoProvider(EnvInfoProvider envInfo)`
`void` | `setEnvironment(java.util.Hashtable environment)` Sets the session environment.
`void` | `setEnvironment(java.lang.Object key, java.lang.Object value)` Sets the session environment.
`void` | `setIgnorePiggyback(boolean ignorePiggyback)` INTERNAL USE ONLY.
`void` | `setInfoObject(java.lang.Object infoObject)` INTERNAL USE ONLY.
`void` | `setMessageContext(ApplicationPoolSvcMsgContext messageContext)` INTERNAL USE ONLY.
`void` | `setMostRecentStackId(int mostRecentStackId)` INTERNAL USE ONLY.
`void` | `setPassivationId(int passivationId)` Sets the identifier for the last persisted session application state.
`void` | `setReferenceCounting(boolean isReferenceCounting)` Advanced Use Only: By default a SessionCookie may invoke `ApplicationModuleRef.useApplicationModule()` an arbitrary number of times with only one matching `releaseApplicationModule(int)` invocation.
`void` | `setReservedPassivationId(int reservedPassivationId)` Set the identifier that will be used to persist the session application state.
`void` | `setSessionCookieListener(SessionCookieListener listener)` Set a session cookie listener on the cookie.
`void` | `setUserData(java.lang.Object name, java.lang.Object value)` Puts user data in the SessionCookie user data map.
`java.lang.String` | `toString()`
`boolean` | `wasActivated()` INTERANL USE ONLY.
`void` | `writeValue(java.lang.Object sink)` Write the cookie value to the specified data sink.
`void` | `writeValue(java.lang.Object sink, java.lang.String value)` Write the specified cookie value to the specified data sink.

Methods inherited from interface oracle.jbo.common.ampool.ApplicationModuleRef
`isApplicationModuleReserved, resetState, useApplicationModule, useApplicationModule, useApplicationModule`

Methods inherited from interface oracle.jbo.ApplicationModuleHandle
`getClientEnvironment, getClientEnvironment, getEnvironment, getEnvironment, getUserData`

Field Detail

### NULL_PASSIVATION_ID

    public static final int NULL_PASSIVATION_ID

  See Also:
    Constant Field Values

### SHARED

    public static final boolean SHARED

  See Also:
    Constant Field Values

### UNSHARED

    public static final boolean UNSHARED

  See Also:
    Constant Field Values

### STATE_MANAGED

    public static final boolean STATE_MANAGED

  See Also:
    Constant Field Values

### STATE_UNMANAGED

    public static final boolean STATE_UNMANAGED

  See Also:
    Constant Field Values

### SHARED_RELEASE_MODE

    public static final int SHARED_RELEASE_MODE

  See Also:
    Constant Field Values

### MANAGED_RELEASE_MODE

    public static final int MANAGED_RELEASE_MODE

  See Also:
    Constant Field Values

### REMOVE_RESOURCE

    public static final int REMOVE_RESOURCE

  See Also:
    Constant Field Values

### FORCE_RELEASE_MODE

    public static final int FORCE_RELEASE_MODE

  See Also:
    Constant Field Values

### SHARED_MANAGED_RELEASE_MODE

    public static final int SHARED_MANAGED_RELEASE_MODE

  See Also:
    Constant Field Values

### SHARED_UNMANAGED_RELEASE_MODE

    public static final int SHARED_UNMANAGED_RELEASE_MODE

  See Also:
    Constant Field Values

### RESERVED_UNMANAGED_RELEASE_MODE

    public static final int RESERVED_UNMANAGED_RELEASE_MODE

  See Also:
    Constant Field Values

### RESERVED_MANAGED_RELEASE_MODE

    public static final int RESERVED_MANAGED_RELEASE_MODE

  See Also:
    Constant Field Values

### BUNDLED_EXC_MODE_KEY

    public static final java.lang.String BUNDLED_EXC_MODE_KEY

  A user data key which may be used to set the ApplicationModule txn bundled exception mode upon next use.
  See Also:
    Constant Field Values

### VALUE_SINK_KEY

    public static final java.lang.String VALUE_SINK_KEY

  See Also:
    Constant Field Values

Method Detail

### releaseApplicationModule

    public void releaseApplicationModule(boolean checkin,
                                         boolean manageState)

  Deprecated. since 9.0.3

  Use `releaseApplicationModule(int)` instead. Replace with the following flags for each checkin/manageState permutation:

  checkin=true, manageState=true: SHARED_MANAGED_RELEASE_MODE checkin=true, manageState=false: SHARED_UNMANAGED_RELEASE_MODE checkin=false, manageState=true: RESERVED_MANAGED_RELEASE_MODE checkin=false, manageState=false: RESERVED_UNMANAGED_RELEASE_MODE

  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 indefinitely. Please see `releaseApplicationModule(boolean, boolean, long)` if a wait timeout is desired.

  The checkin parameter may be used to indicate that the session application module instance should be checked in for reuse by other sessions.

  The manageState parameter may be used to indicate that the session application state should be managed between requests by the pooling framework.

  Specified by:
    `releaseApplicationModule` in interface `ApplicationModuleRef`
  Parameters:
    `checkin` - `SHARED` or `UNSHARED`
    `manageState` - manage the session application state between requests

### releaseApplicationModule

    public void releaseApplicationModule(boolean checkin,
                                         boolean manageState,
                                         long waitTimeout)

  Deprecated. since 9.0.3

  use `releaseApplicationModule(int, long)` instead. Replace with the following flags each checkin/manageState permutation: checkin=true, manageState=true: SHARED_MANAGED_RELEASE_MODE checkin=true, manageState=false: SHARED_UNMANAGED_RELEASE_MODE checkin=false, manageState=true: RESERVED_MANAGED_RELEASE_MODE checkin=false, manageState=false: RESERVED_UNMANAGED_RELEASE_MODE

  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 `ApplicationModuleRef.useApplicationModule(boolean)`.

  The checkin parameter may be used to indicate that the session application module instance should be checked in for reuse by other sessions.

  The manageState parameter may be used to indicate that the session application state should be managed between requests by the pooling framework.

  Specified by:
    `releaseApplicationModule` in interface `ApplicationModuleRef`
  Parameters:
    `checkin` - `SHARED` or `UNSHARED`
    `manageState` - `STATE_MANAGED` or `STATE_UNMANAGED`
    `waitTimeout` - specifies the amount of time in milliseconds that the thread should wait for the session cookie lock

### releaseApplicationModule

    public void releaseApplicationModule(int releaseFlags,
                                         long waitTimeout)

  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 `ApplicationModuleRef.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.

  Parameters:
    `releaseFlags` - the desired releaseFlags. Must be one of the following release modes: SHARED_MANAGED_RELEASE_MODE SHARED_UNMANAGED_RELEASE_MODE RESERVED_UNMANAGED_RELEASE_MODE RESERVED_MANAGED_RELEASE_MODE
    `waitTimeout` - specifies the amount of time in milliseconds that the thread should wait for the session cookie lock

### releaseApplicationModule

    public void releaseApplicationModule(int releaseFlags)

  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 `ApplicationModuleRef.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.

  Parameters:
    `releaseFlags` - the desired releaseFlags. Must be one of the following release modes: SHARED_MANAGED_RELEASE_MODE SHARED_UNMANAGED_RELEASE_MODE RESERVED_UNMANAGED_RELEASE_MODE RESERVED_MANAGED_RELEASE_MODE

### isApplicationModuleReleased

    public boolean isApplicationModuleReleased()

  Determines if the ApplicationModule which is referenced by this session has been released to the ApplicationPool. If this SessionCookie is not referencing an ApplicationModule then true is returned.

  This method differs from `ApplicationModuleRef.isApplicationModuleReserved()` in that isApplicationModuleReserved will return true if an unshared or reserved release mode has been used to release an ApplicationModule.

### isApplicationModuleReleasedByThread

    public boolean isApplicationModuleReleasedByThread()

  If the cookie is multi-threaded then this method will determine if the invoking thread has released the SessionCookie ApplicationModule.

  If the SessionCookie ApplicationModule has been released then true will be returned.

  If the invoking thread did not previously invoke `ApplicationModuleRef.useApplicationModule()` since the last release then true will be returned.

  If the cookie is single threaded then this method will return the same result as `isApplicationModuleReleased()`

  See Also:
    `isApplicationModuleReleased()`

### getApplicationId

    public java.lang.String getApplicationId()

  Returns the application id for this session cookie.

### getSessionId

    public java.lang.String getSessionId()

  Returns the session identifier.

  Session identifers should be uniques across sessions and consistent across servers.

### getValue

    public java.lang.String getValue()

  Returns the session cookie value.

  Session cookie values represent the session application state.

### getEnvInfoProvider

    public EnvInfoProvider getEnvInfoProvider()

### setEnvInfoProvider

    public void setEnvInfoProvider(EnvInfoProvider envInfo)

### writeValue

    public void writeValue(java.lang.Object sink)

  Write the cookie value to the specified data sink.
  Parameters:
    `sink` - a data sink

### writeValue

    public void writeValue(java.lang.Object sink,
                           java.lang.String value)

  Write the specified cookie value to the specified data sink.
  Parameters:
    `sink` - a data sink

### readValue

    public java.lang.String readValue(java.lang.Object source)

  Read the cookie value to the specified data sink.
  Parameters:
    `source` - a data source

### getPassivationId

    public int getPassivationId()

  Return an identifier for the last persisted session application state. The passivation id should may used to activate a previous application state.

### setPassivationId

    public void setPassivationId(int passivationId)

  Sets the identifier for the last persisted session application state.

### reservePassivationId

    public void reservePassivationId()

  Reserves a unique identifier for the session application. The identifier will be used to persist the session application state if session state management has been enabled.

  A passivation id should not be reserved if one has already been reserved or if failover is disabled.

  See Also:
    `getReservedPassivationId()`

### reservePassivationId

    public void reservePassivationId(java.lang.Object sink)

  Reserves a unique identifier for the session application. The identifier will be used to persist the session application state if session state management has been enabled.

  If a not null sink is passed then reservePassivationId should persist the reserved passivation id to the sink using `writeValue(Object)`.

  A passivation id should not be reserved if one has already been reserved or if failover is disabled.

  See Also:
    `getReservedPassivationId()`

### passivateState

    public void passivateState(java.lang.Object sink)

  Passivates the session ApplicationModule state.

  If a not null sink is passed then passivateState should persist the passivation id to the sink using `writeValue(Object)`.

  State passivation should not take place if failover is disabled.

### getReservedPassivationId

    public int getReservedPassivationId()

  Return the identifier that will be used to persist the session application state at the end of the request.

  The next passivation id should be used when generating the session cookie value.

### getMostRecentStackId

    public int getMostRecentStackId()

  If the current thread holds an active ApplicationModule reference then this method will delegate to `ApplicationModule.getMostRecentStackId()`.

  If the current thread does not reference a reserved ApplicationModule then this method will return a local copy of the most recent stack id.

  The local copy is updated in the following circumstances:

  1. `reservePassivationId()` is invoked.
  2. An ApplicationModule is released by this SessionCookie.
  3. `getMostRecentStackId()` is invoked while the SessionCookie holds an active ApplicationModule reference.

  The local stack snapshot id allows SessionCookie clients to reuse persistent snapshot ids as stack snapshots. This will reduce the memory overhead of maintaining an in-memory snapshot of an ApplicationModule state. This method should only be used if failover has been enabled.

  This method is really only useful for clients that have enabled failover and require the stack id after the ApplicationModule has been released. Invoking this method while an active ApplicationModule reference is held is equivalent to invoking `ApplicationModule.getMostRecentStackId()` and therefore does not add any value.

### setMostRecentStackId

    public void setMostRecentStackId(int mostRecentStackId)

  INTERNAL USE ONLY. Applications should not use this method.

  This method is used by the pooling framework to set the local most recent stack id.

  See Also:
    `getMostRecentStackId()`

### setReservedPassivationId

    public void setReservedPassivationId(int reservedPassivationId)

  Set the identifier that will be used to persist the session application state.

### resetStateInternal

    public void resetStateInternal()

  INTERNAL USE ONLY. Applications should not use this method.

### getPoolSignature

    public long getPoolSignature()

  Returns the signature of the pool for which this session cookie is a handle.

### setEnvironment

    public void setEnvironment(java.util.Hashtable environment)

  Sets the session environment. When creating a session cookie the application pool should use this method to initialize the new session cookie instance with the default pool environment. After initializiation the developer may use this method to modify any session level application pool properties. An ApplicationPoolException will be thrown if this method is invoked after the session cookie has become active.

### setEnvironment

    public void setEnvironment(java.lang.Object key,
                               java.lang.Object value)

  Sets the session environment. When creating a session cookie the application pool should use this method to initialize the new session cookie instance with the default pool environment. After initializiation the developer may use this method to modify any session level application pool properties. An ApplicationPoolException will be thrown if this method is invoked after the session cookie has become active.

### getSyncLock

    public java.lang.Object getSyncLock()

  INTERNAL USE ONLY. Applications should not use this method.

### getLastUpdate

    public java.util.Date getLastUpdate()

  Returns a date value indicating the last time the state of this cookie was updated.

### getLastUpdateLong

    public long getLastUpdateLong()

### copyInto

    public void copyInto(SessionCookie cookie)

  Copies the state of this cookie into the target cookie.
  Parameters:
    `cookie` - the target of the copy.

### isFailoverEnabled

    public boolean isFailoverEnabled()

  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.

### isConnectionPoolingEnabled

    public boolean isConnectionPoolingEnabled()

  Indicates that the session application module resource's JDBC connection should be released immediately upon release to the application pool.

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

### isResetNonTransactionalState

    public boolean isResetNonTransactionalState()

  Indicates whether or not the non-transactional state of the session application module resource should be preserved upon an unmanaged release to the application pool.

  Transactional state includes the state of the transaction caches (EO and VO) and database state. Non-transactional state includes child view usage and application module usage instances and their related state including dynamic where clauses, order by clauses, and bind parameters. If connection pooling has been disabled for the application pool then non-transaction state will also include any cached JDBC statements.

### isActivationRequired

    public boolean isActivationRequired()

  Deprecated. ApplicationDevelopers should instead override:

  `isActivationRequired(ApplicationModule)`

  This method will still be invoked from the new method.

  Indicates that state activation is required upon the next checkout for this session. INTERNAL USE ONLY. Applications should not use this method.
  Since:
    9.0.2

### getEnvConfigurationName

    public java.lang.String getEnvConfigurationName()

  Return the name of the BC4J configuration that was used to initialize the SessionCookie environment. The name of the configuration will be a package qualified name. If the pool environment was not initialized by a BC4J configuration then this method will return null.

### isActivationRequired

    public boolean isActivationRequired(ApplicationModule context)

  Indicates that state activation is required upon the next checkout for this session. The application module is passed to provide some context for the activation check. For example, an advanced developer could store some additional properties on the ApplicationModule to indicate whether or not it is necessary to activate that ApplicationModule.

  The ApplicationModule may not yet be in a valid state so care should be taken when accessing the ApplicationModule from a custom SessionCookie implementation.

  This method is invoked only if the session's affinity to its ApplicationModule was maintained between requests. The return value of this method is ignored if the session's affinity to its ApplicationModule was lost. INTERNAL USE ONLY. Applications should not use this method.

### setActivationRequired

    public void setActivationRequired(boolean activateRequired)

  May be used to force activation upon the next checkout for this session. INTERNAL USE ONLY. Applications should not use this method.

### setSessionCookieListener

    public void setSessionCookieListener(SessionCookieListener listener)

  Set a session cookie listener on the cookie. INTERNAL USE ONLY. Applications should not use this method.

### toString

    public java.lang.String toString()

### hashCode

    public int hashCode()

### equals

    public boolean equals(java.lang.Object obj)

### getSSOUserName

    public java.lang.String getSSOUserName()

### getSSOSubscriber

    public java.lang.String getSSOSubscriber()

### getThreadRefCount

    public int getThreadRefCount()

  INTERNAL USE ONLY. Applications should not use this method.

### setReferenceCounting

    public void setReferenceCounting(boolean isReferenceCounting)

  Advanced Use Only: By default a SessionCookie may invoke `ApplicationModuleRef.useApplicationModule()` an arbitrary number of times with only one matching `releaseApplicationModule(int)` invocation. The release will always result in the ApplicationModule being released to the ApplicationPool. If reference counting is enabled then the number of release invocations must match the number of use invocations and only the last release will result in the ApplicationModule being released to the ApplicationPool.

### setUserData

    public void setUserData(java.lang.Object name,
                            java.lang.Object value)

  Puts user data in the SessionCookie user data map. The user data is associated with the specified key.

  SessionCookie user data is automatically synched with the ApplicationModule upon ApplicationModule use.

### getUserData

    public java.lang.Object getUserData(java.lang.Object name)

  Acquires the user data associated with the specified key from the SessionCookie user data map.

### removeUserData

    public java.lang.Object removeUserData(java.lang.Object name)

  Removes the user data associated with the specified key from the SessionCookie user data map.

### getIgnorePiggyback

    public boolean getIgnorePiggyback()

  INTERNAL USE ONLY. Used by BC4J to ignore piggyback messages for doPoolMessages processed on behalf of this cookie by the ApplicationPool. Used by the WSApplicationModule to prevent unnecessary state reset due to loss of affinity. ApplicationModule associations.

### setIgnorePiggyback

    public void setIgnorePiggyback(boolean ignorePiggyback)

  INTERNAL USE ONLY. Used by BC4J to ignore piggyback messages for doPoolMessages processed on behalf of this cookie by the ApplicationPool. Used by the WSApplicationModule to prevent unnecessary state reset due to loss of affinity. ApplicationModule associations.

### wasActivated

    public boolean wasActivated()

  INTERANL USE ONLY. Used by BC4J to perform special handling if it detects that a pool request required activation.

### setActivated

    public void setActivated(boolean activated)

  INTERNAL USE ONLY. Used by BC4J to perform special handling if it detects that a pool request required activation.

### getMessageContext

    public ApplicationPoolSvcMsgContext getMessageContext()

  Returns the current message context for this cookie. A message context represents a batch request from the ApplicationPool for this SessionCookie. The message context may be null if no request is currently active for this SessionCookie.

  The request represented by this message context should not be confused with the user request. The pool request represents a request from the pool to be performed by a request handler upon the poolable resource. There may be many pool requests issued during a single user request. For example, two pool requests will be required to acquire and release an ApplicationModule.

  An application may access the message context during request processing in order to acquire more information about the pool request. For example, the DefaultConnectionStrategy uses the ApplicationPoolSvcMsgContext to acquire the user credentials that are to be used for connect.

### setMessageContext

    public void setMessageContext(ApplicationPoolSvcMsgContext messageContext)

  INTERNAL USE ONLY.

### getInfoObject

    public java.lang.Object getInfoObject()

  INTERNAL USE ONLY. Return the info structure that is used by the ApplicationPool to maintain additional information about this SessionCookie.

### setInfoObject

    public void setInfoObject(java.lang.Object infoObject)

  INTERNAL USE ONLY. See `getInfoObject()`.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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