|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.common.ampool.SessionCookieImpl
Default SessionCookie implementation.
Default session cookie instances should only be instantiated by an
application pool. This is required because the default session cookie
uses the application pool framework to manage application state
and to share application module instances between requests. Please see
ApplicationPool.createSessionCookie(String, String, Properties)
for more information about creating session cookies.
The default implementation uses a session cookie lock to prevent access to the session cookie application module resource by multiple threads. A lock is obtained when a thread invokes useApplicationModule. The lock is released when the thread invokes releaseApplicationModule.
Please see SessionCookie
for more
information about session cookies.
Fields inherited from interface oracle.jbo.common.ampool.SessionCookie |
NULL_PASSIVATION_ID |
Constructor Summary |
SessionCookieImpl(java.lang.String applicationId,
java.lang.String sessionId,
ApplicationPool pool)
Constructor. |
Method Summary |
Type | Method |
---|---|
void |
copyInto(SessionCookie cookie)
Copies the state of this cookie into the target cookie. |
boolean |
equals(java.lang.Object obj)
Session cookies are equal if their application and session identifiers are equal |
java.lang.String |
getApplicationId()
Returns the application id for this session cookie. |
EnvInfoProvider |
getEnvInfoProvider()
|
java.util.Hashtable |
getEnvironment()
Returns the session environment. |
java.util.Date |
getLastUpdate()
Returns a date value indicating the last time the state of this cookie was updated. |
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. |
protected boolean |
getProperty(java.lang.String name,
java.util.Hashtable environment,
boolean defaultValue)
|
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.Object |
getSyncLock()
INTERNAL USE ONLY. |
java.util.Hashtable |
getUserData()
Returns a HashTable which may be used to store user specific context that is related to this application session. |
java.lang.String |
getValue()
Returns the session cookie value. |
int |
hashCode()
|
boolean |
isActivationRequired()
Indicates that state activation is required upon the next checkout for this session. |
boolean |
isApplicationModuleReserved()
Tests if the application module that is referenced by this session cookie has been reserved for exclusive access by this session cookie. |
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. |
static int |
parsePassivationId(java.lang.String cookieValue)
|
static java.lang.String |
parseSessionId(java.lang.String cookieValue)
|
java.lang.String |
readValue(java.lang.Object source)
Read the cookie value to the specified data sink. |
void |
releaseApplicationModule(boolean checkin,
boolean manageState)
The default implementation will release the session cookie lock after having checked in the session application module. |
void |
releaseApplicationModule(boolean checkin,
boolean manageState,
long waitTimeout)
The default implementation will release the session cookie lock after having checked in the session application module. |
void |
reservePassivationId()
Reserves a unique identifier for the session application. |
void |
resetState()
Reset the mutable state of the session cookie. |
void |
setActivationRequired(boolean activationRequired)
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 |
setPassivationId(int passivationId)
Sets the identifier for the last persisted session application state. |
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 |
timeout()
Internal use only. |
java.lang.String |
toString()
|
ApplicationModule |
useApplicationModule()
Returns an application module instance without acquiring a session cookie lock. |
ApplicationModule |
useApplicationModule(boolean lock)
Returns an application module instance for the current thread. |
ApplicationModule |
useApplicationModule(boolean lock,
long waitTimeout)
The default implementation must obtain a session cookie lock before checking an application module instance out from the pool. |
void |
writeValue(java.lang.Object sink)
Write the cookie value to the specified data sink. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SessionCookieImpl(java.lang.String applicationId, java.lang.String sessionId, ApplicationPool pool)
Applications should not invoke this constructor directly. A session cookie factory should be used instead.
The implementation requires that all three parameters be not null.
applicationId
- a unique identifier for the session applicationsessionId
- a unique identifer for the sessionpool
- an application pool instancetimeout
- the amount of
time a thread should wait for an application module resourceMethod Detail |
public EnvInfoProvider getEnvInfoProvider()
getEnvInfoProvider
in interface SessionCookie
public void setEnvInfoProvider(EnvInfoProvider envInfo)
setEnvInfoProvider
in interface SessionCookie
public java.util.Date getLastUpdate()
SessionCookie
getLastUpdate
in interface SessionCookie
public java.lang.String toString()
toString
in interface SessionCookie
toString
in class java.lang.Object
public int hashCode()
hashCode
in interface SessionCookie
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface SessionCookie
equals
in class java.lang.Object
public long getPoolSignature()
SessionCookie
getPoolSignature
in interface SessionCookie
public java.lang.String getApplicationId()
SessionCookie
getApplicationId
in interface SessionCookie
public java.lang.String getSessionId()
SessionCookie
Session identifers should be uniques across sessions and consistent across servers.
getSessionId
in interface SessionCookie
public java.lang.String getValue()
SessionCookie
Session cookie values represent the session application state.
getValue
in interface SessionCookie
public java.util.Hashtable getEnvironment()
SessionCookie
getEnvironment
in interface SessionCookie
public void setEnvironment(java.util.Hashtable environment)
SessionCookie
setEnvironment
in interface SessionCookie
public boolean isApplicationModuleReserved()
ApplicationModuleRef
isApplicationModuleReserved
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
public ApplicationModule useApplicationModule()
ApplicationModuleRef
useApplicationModule
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
ApplicationModuleRef.useApplicationModule(boolean, long)
public ApplicationModule useApplicationModule(boolean lock)
ApplicationModuleRef
useApplicationModule
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
lock
- specify whether a session lock should be acquired for the
shared application module resourceApplicationModuleRef.useApplicationModule(boolean, long)
public ApplicationModule useApplicationModule(boolean lock, long waitTimeout)
useApplicationModule
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
lock
- specify whether a session lock should be acquired for the
shared application module resourcewaitTimeout
- specifies the amount of time in milliseconds that the
thread should wait for the session cookie lockpublic void timeout()
public void releaseApplicationModule(boolean checkin, boolean manageState)
releaseApplicationModule
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
checkin
- manageState
- manage the session application state between requestspublic void releaseApplicationModule(boolean checkin, boolean manageState, long waitTimeout)
releaseApplicationModule
in interface ApplicationModuleRef
oracle.jbo.common.ampool.ApplicationModuleRef
checkin
- manageState
- manage the session application state between requestswaitTimeout
- specifies the amount of time in milliseconds that the
thread should wait for the session cookie lockpublic void writeValue(java.lang.Object sink)
SessionCookie
writeValue
in interface SessionCookie
oracle.jbo.common.ampool.SessionCookie
sink
- a data sinkpublic java.lang.String readValue(java.lang.Object source)
SessionCookie
readValue
in interface SessionCookie
oracle.jbo.common.ampool.SessionCookie
source
- a data sourcepublic java.lang.Object getSyncLock()
SessionCookie
getSyncLock
in interface SessionCookie
public boolean isActivationRequired()
SessionCookie
isActivationRequired
in interface SessionCookie
public void setActivationRequired(boolean activationRequired)
SessionCookie
setActivationRequired
in interface SessionCookie
public int getPassivationId()
SessionCookie
getPassivationId
in interface SessionCookie
public void setPassivationId(int passivationId)
SessionCookie
setPassivationId
in interface SessionCookie
public void reservePassivationId()
SessionCookie
A passivation id should not be reserved if one has already been reserved, if the session cookie does not reference a reserved application module, or if failover is disabled.
reservePassivationId
in interface SessionCookie
oracle.jbo.common.ampool.SessionCookie
SessionCookie.getReservedPassivationId()
public int getReservedPassivationId()
SessionCookie
The next passivation id should be used when generating the session cookie value.
getReservedPassivationId
in interface SessionCookie
public void setReservedPassivationId(int reservedPassivationId)
SessionCookie
setReservedPassivationId
in interface SessionCookie
public java.util.Hashtable getUserData()
SessionCookie
getUserData
in interface SessionCookie
public void resetState()
SessionCookie
resetState
in interface SessionCookie
public void copyInto(SessionCookie cookie)
SessionCookie
copyInto
in interface SessionCookie
oracle.jbo.common.ampool.SessionCookie
cookie
- the target of the copy.public boolean isFailoverEnabled()
SessionCookie
Session cookie developers should be careful that this value not change after a session cookie has become active.
isFailoverEnabled
in interface SessionCookie
public boolean isConnectionPoolingEnabled()
SessionCookie
Session cookie developers should be careful that this value not change after a session cookie has become active.
isConnectionPoolingEnabled
in interface SessionCookie
public boolean isResetNonTransactionalState()
SessionCookie
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.
isResetNonTransactionalState
in interface SessionCookie
protected boolean getProperty(java.lang.String name, java.util.Hashtable environment, boolean defaultValue)
public void setSessionCookieListener(SessionCookieListener listener)
SessionCookie
setSessionCookieListener
in interface SessionCookie
public static java.lang.String parseSessionId(java.lang.String cookieValue)
public static int parsePassivationId(java.lang.String cookieValue)
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |