|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.servlet.AbstractHttpSessionModel
Deprecated. In releases following 3.6 customization will be declarative.
public abstract class AbstractHttpSessionModel
An abstract base class from which implementations of HttpSessionModel can be more easily built.
Note that the Externalizable implementation on this class is just there to throw exceptions that this class is not Serializable or Externalizable. Use ExternalizableLite instead.
Field Summary | |
---|---|
static java.lang.String |
CTX_OPTIMIZE_MODIFIED_SESSIONS Deprecated. The configuration property that specifies to use the flush cache optimization for sessions that have been modified. |
static int |
MAGIC_V350 Deprecated. Coherence*Web version identifier for serialization. |
java.lang.String[] |
STRING_ARRAY Deprecated. Zero-length array of String objects. |
Constructor Summary | |
---|---|
AbstractHttpSessionModel() Deprecated. Default constructor for deserialization. |
|
AbstractHttpSessionModel(AbstractHttpSessionCollection collection, javax.servlet.http.HttpSession session, java.lang.String sId) Deprecated. Session creation constructor. |
Method Summary | |
---|---|
protected void |
activate(javax.servlet.http.HttpSession session) Deprecated. Activate the session model. |
protected void |
addEnteredThread() Deprecated. Add the currently running thread to the list of threads that have entered this session model. |
protected void |
bind(AttributeHolder holderOld, AttributeHolder holderNew) Deprecated. Bind the specified session attribute, replacing the specified attribute if it exists. |
protected void |
checkActive() Deprecated. Make sure that the model is 'active', 'usable' and 'valid'. |
protected void |
checkUsable() Deprecated. Make sure that the model is 'usable'. |
protected void |
checkValid() Deprecated. Make sure that the model is 'usable' and 'valid'. |
protected void |
discard() Deprecated. When the session model is no longer usable, it is discarded. |
protected void |
enter() Deprecated. Increment the usage count of the session by this thread. |
protected void |
exit() Deprecated. Decrement the usage count of the session by this thread. |
protected java.lang.String |
extractAttributeName(java.lang.String sAttribute) Deprecated. Given a potentially qualified attribute name, return the original (fully unqualified) attribute name. |
protected java.lang.String[] |
extractAttributeNames(java.lang.String[] asAttribute) Deprecated. Given an array of potentially qualified attribute name, return an array of the original (fully unqualified) attribute names. |
protected void |
flush() Deprecated. Flush the changes to this model to whatever data structure (for example, a cache) that is responsible for managing the model's data. |
protected java.util.Map |
getActualAttributeMap() Deprecated. Get the map of session attributes that are part of this session (not "local".) |
java.lang.Object |
getAttribute(java.lang.String sName) Deprecated. Returns the object bound with the specified name in this session, or null if no object is bound under the name. |
protected java.util.Map |
getAttributeMap() Deprecated. Get a view of the session's attributes as a Map. |
java.lang.String[] |
getAttributeNameArray() Deprecated. Returns an array of attribute names for this session. |
protected AbstractHttpSessionCollection |
getCollection() Deprecated. Determine the collection that this model belongs to. |
long |
getCreationTime() Deprecated. Returns the creation time for this session. |
protected java.lang.String |
getDescription() Deprecated. Returns a string representation of this object's attributes. |
protected java.util.Set |
getEnteredThreads() Deprecated. Retrieve the list of all threads that have entered this session model. |
protected javax.servlet.http.HttpSession |
getHttpSession() Deprecated. Determine the HttpSession that this model is bound to. |
java.lang.String |
getId() Deprecated. Returns the session identifier for this session. |
long |
getLastAccessedTime() Deprecated. Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. |
protected long |
getLastFlushedTime() Deprecated. Returns the last time this session was flushed, as the number of milliseconds since midnight, January 1, 1970 GMT. |
protected java.util.Map |
getLocalAttributeMap() Deprecated. Get the map of session attributes that are owned by this model but are stored in a "local" manner. |
int |
getMaxInactiveInterval() Deprecated. Returns the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. |
java.lang.String |
getNewId() Deprecated. Returns the updated session identifier for this session after authentication. |
int |
getReferenceCount() Deprecated. Determine the reference count (unmatched enter calls) for this model. |
protected java.lang.Thread |
getThreadOwner() Deprecated. Retrieve the thread that has entered this session model. |
protected int |
getVersion() Deprecated. Return the version indicator for this model. |
protected AttributeHolder |
instantiateAttributeHolder() Deprecated. Factory method: Instantiate an AttributeHolder for deserialization purposes. |
protected AttributeHolder |
instantiateAttributeHolder(java.lang.String sName, java.lang.Object oValue) Deprecated. Factory method: Instantiate an AttributeHolder to manage the passed value. |
protected boolean |
isActivatableAttributes() Deprecated. Determine if the session model may have attributes that need to be activated and passivated. |
protected boolean |
isActive() Deprecated. Determine if the session model is active (not passivated). |
boolean |
isExpired() Deprecated. A helper method to determine if the session data has expired. |
protected boolean |
isExpiredInternal(long currentTime) Deprecated. Check if the session has expired. |
static boolean |
isImmutable(java.lang.Object o) Deprecated. Determine if the passed object is definitely of an immutable type. |
protected boolean |
isLastAccessTimeFlushRequired() Deprecated. Determine if the LastAccessTime property (and only that property) needs to be flushed. |
protected boolean |
isLocal() Deprecated. Determine whether the session is local (not distributed). |
protected boolean |
isModified() Deprecated. Determine if the session has been modified since it was deserialized or last marked as not-modified. |
boolean |
isNew() Deprecated. Returns true if the client does not yet know about the session or if the client chooses not to join the session. |
protected boolean |
isOwnedByThisThread() Deprecated. Determine if this model is owned by the current thread. |
boolean |
isUsable() Deprecated. Determine if this session model is a usable object. |
boolean |
isValid() Deprecated. Determine if this session model is valid. |
protected void |
logAttributeSerializationFailure(AttributeHolder holder, java.lang.Throwable e) Deprecated. Log a serialization failure for an attribute holder. |
protected boolean |
obtainThreadOwnership() Deprecated. Obtain thread ownership of this model, if necessary. |
protected void |
passivate() Deprecated. Passivate the session model. |
protected java.lang.String |
qualifyAttributeName(java.lang.String sAttribute) Deprecated. Given an attribute name, return a potentially qualified name. |
protected void |
readAttributes(java.io.DataInput in) Deprecated. Helper to read the session attributes from a stream. |
void |
readExternal(java.io.DataInput in) Deprecated. Helper to read the object state from a stream. |
void |
readExternal(java.io.ObjectInput in) Deprecated. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
protected void |
releaseThreadOwnership() Deprecated. Release thread ownership of this model. |
void |
removeAttribute(java.lang.String sName) Deprecated. Removes the object bound with the specified name from this session. |
protected void |
removeEnteredThread() Deprecated. Remove the currently running thread from the list of threads that have entered this session model. |
void |
sessionReturned() Deprecated. Indicates to the session that it is no longer new, because the session ID has been returned to the client to allow the client to accept it, as described in the Servlet specification. |
protected void |
setActivatableAttributes(boolean fActivatable) Deprecated. Specify whether the session model may or may not have attributes that need to be activated and passivated. |
void |
setAttribute(java.lang.String sName, java.lang.Object oValue) Deprecated. Binds an object to this session, using the name specified. |
protected void |
setCollection(AbstractHttpSessionCollection collection) Deprecated. After deserialization, the collection needs to be configured. |
protected void |
setHttpSession(javax.servlet.http.HttpSession session) Deprecated. Configure the HttpSession that this model is bound to. |
protected void |
setId(java.lang.String sId) Deprecated. Allow a sub-class to specify the session ID, for example during deserialization. |
protected void |
setLastAccessedTime(long ldtLastAccessedTime) Deprecated. Set the time this session was last accessed, as the number of milliseconds since midnight, January 1, 1970 GMT. |
protected void |
setLastFlushedTime(long ldtLastFlushedTime) Deprecated. Set the time this session was last flushed, as the number of milliseconds since midnight, January 1, 1970 GMT. |
void |
setMaxInactiveInterval(int cSeconds) Deprecated. Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. |
protected void |
setModified(boolean fModified) Deprecated. Specify whether or not the session has been modified. |
protected void |
setNewId(java.lang.String sNewId) Deprecated. Set the updated session id after authentication has occured. |
protected void |
setValid(boolean fValid) Deprecated. Allow a sub-class to explicitly validate the session model, for example at the completion of deserialization. |
protected void |
setVersion(int nVersion) Deprecated. Set the version indicator of this model. |
java.lang.String |
toString() Deprecated. Returns a string representation of the object. |
void |
touch() Deprecated. Update the last-accessed time for the session. |
protected void |
unbind() Deprecated. Unbind session attributes. |
protected void |
unbind(AttributeHolder holder, boolean fAll) Deprecated. Unbind the specified session attributes name and value. |
protected void |
writeAttributes(java.io.DataOutput out) Deprecated. Helper to write the session attributes to a stream. |
void |
writeExternal(java.io.DataOutput out) Deprecated. Helper to write the object state to a stream. |
void |
writeExternal(java.io.ObjectOutput out) Deprecated. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
Field Detail |
---|
public java.lang.String[] STRING_ARRAY
public static final int MAGIC_V350
public static final java.lang.String CTX_OPTIMIZE_MODIFIED_SESSIONS
Constructor Detail |
---|
public AbstractHttpSessionModel()
public AbstractHttpSessionModel(AbstractHttpSessionCollection collection, javax.servlet.http.HttpSession session, java.lang.String sId)
collection
- the collection that manages this modelsession
- the session that delegates to this modelsId
- the session IDMethod Detail |
---|
public java.lang.Object getAttribute(java.lang.String sName)
null
if no object is bound under the name.getAttribute
in interface HttpSessionModel
sName
- a string specifying the name of the objectpublic java.lang.String[] getAttributeNameArray()
getAttributeNameArray
in interface HttpSessionModel
String
objects specifying the names of all the objects bound to this sessionpublic long getCreationTime()
getCreationTime
in interface HttpSessionModel
public java.lang.String getId()
getId
in interface HttpSessionModel
public java.lang.String getNewId()
public long getLastAccessedTime()
getLastAccessedTime
in interface HttpSessionModel
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface HttpSessionModel
public boolean isExpired()
isExpired
in interface HttpSessionModel
protected boolean isExpiredInternal(long currentTime)
currentTime
- the current time in millispublic boolean isNew()
true
if the client does not yet know about the session or if the client chooses not to join the session. For example, if the server used only cookie-based sessions, and the client had disabled the use of cookies, then a session would be new on each request.isNew
in interface HttpSessionModel
true
if the server has created a session, but the client has not yet joinedpublic boolean isUsable()
When a session model becomes unusable, the only method that can be assumed to respond without throwing an exception is HttpSessionModel.getId()
.
isUsable
in interface HttpSessionModel
public boolean isValid()
isValid
in interface HttpSessionModel
true
if the session has not been destroyed, otherwise false
public void removeAttribute(java.lang.String sName)
removeAttribute
in interface HttpSessionModel
sName
- the name of the object to remove from this sessionpublic void sessionReturned()
sessionReturned
in interface HttpSessionModel
public void setAttribute(java.lang.String sName, java.lang.Object oValue)
setAttribute
in interface HttpSessionModel
sName
- the name to which the object is bound; cannot be nulloValue
- the object to be bound; cannot be nullpublic void setMaxInactiveInterval(int cSeconds)
setMaxInactiveInterval
in interface HttpSessionModel
cSeconds
- the new maximum intervalpublic void touch()
touch
in interface HttpSessionModel
public java.lang.String toString()
protected AbstractHttpSessionCollection getCollection()
protected void setCollection(AbstractHttpSessionCollection collection)
collection
- the AbstractHttpSessionCollection that this model belongs toprotected javax.servlet.http.HttpSession getHttpSession()
protected void setHttpSession(javax.servlet.http.HttpSession session)
session
- the HttpSession that this model is bound to; may be null to deactivate the modelprotected void setId(java.lang.String sId)
sId
- the session idprotected void setNewId(java.lang.String sNewId)
sNewId
- the new session idprotected void setValid(boolean fValid)
fValid
- true if the session model is valid, false otherwiseprotected int getVersion()
The version indicator is used to detect concurrent modifications when member-level locking is disabled.
protected void setVersion(int nVersion)
nVersion
- the new version indicator; must be >= 0protected boolean isLocal()
protected java.util.Map getAttributeMap()
protected java.util.Map getActualAttributeMap()
protected java.util.Map getLocalAttributeMap()
protected boolean isActive()
protected boolean isActivatableAttributes()
protected void setActivatableAttributes(boolean fActivatable)
fActivatable
- passtrue if any of the session attributes may require activationprotected void activate(javax.servlet.http.HttpSession session)
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
session
- the HttpSession to bind this model toprotected void passivate()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
protected void bind(AttributeHolder holderOld, AttributeHolder holderNew)
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
holderOld
- the attribute information to unbind; may be nullholderNew
- the attribute information to bindprotected void unbind(AttributeHolder holder, boolean fAll)
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
holder
- the attribute information to unbindfAll
- true if this method is called within the context of an unbind()
callprotected void unbind()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
protected void logAttributeSerializationFailure(AttributeHolder holder, java.lang.Throwable e)
holder
- the attribute holder that failed to serialize its valuee
- the throwable object that resulted from the serialization failureprotected void discard()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
protected boolean isModified()
protected void setModified(boolean fModified)
fModified
- true if the session has been modified, false to reset the modified indicatorprotected void setLastAccessedTime(long ldtLastAccessedTime)
ldtLastAccessedTime
- the last time this session was accessed, as the number of milliseconds since midnight, January 1, 1970 GMTprotected long getLastFlushedTime()
protected void setLastFlushedTime(long ldtLastFlushedTime)
ldtLastFlushedTime
- the last time this session was flushed, as the number of milliseconds since midnight, January 1, 1970 GMTprotected boolean isLastAccessTimeFlushRequired()
protected java.util.Set getEnteredThreads()
protected void addEnteredThread()
protected void removeEnteredThread()
protected java.lang.Thread getThreadOwner()
protected boolean obtainThreadOwnership()
If thread locking is enforced this method has no effect and false is returned; otherwise, this model is locked in the local owned cache and true is returned. A return value of true implies that releaseThreadOwnership()
must be called when exclusive access to the model is no longer required.
AbstractHttpSessionCollection.obtainThreadOwnership(String)
protected void releaseThreadOwnership()
AbstractHttpSessionCollection.releaseThreadOwnership(String)
protected boolean isOwnedByThisThread()
public int getReferenceCount()
getReferenceCount
in interface HttpSessionModel
protected void enter()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
protected void exit()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
protected void flush()
This method may only be called by a thread that owns this model. See AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String)
.
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if an I/O exception occurspublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write the object tojava.io.IOException
- if an I/O exception occurspublic void readExternal(java.io.DataInput in) throws java.io.IOException
readExternal
in interface ExternalizableLite
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if an I/O exception occurspublic void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface ExternalizableLite
out
- the stream to write the object tojava.io.IOException
- if an I/O exception occursprotected void readAttributes(java.io.DataInput in) throws java.io.IOException
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if an I/O exception occursprotected void writeAttributes(java.io.DataOutput out) throws java.io.IOException
out
- the stream to write the object tojava.io.IOException
- if an I/O exception occursprotected java.lang.String getDescription()
protected void checkActive()
java.lang.IllegalStateException
- if the model is not 'active', 'usable' and 'valid'protected void checkValid()
java.lang.IllegalStateException
- if the model is not both 'usable' and 'valid'protected void checkUsable()
java.lang.IllegalStateException
- if the model is not 'usable'protected java.lang.String qualifyAttributeName(java.lang.String sAttribute)
sAttribute
- the name that the application identifies the attribute byprotected java.lang.String extractAttributeName(java.lang.String sAttribute)
sAttribute
- an attribute name that may be qualifiedprotected java.lang.String[] extractAttributeNames(java.lang.String[] asAttribute)
asAttribute
- an array of attribute names that may be qualifiedprotected AttributeHolder instantiateAttributeHolder()
protected AttributeHolder instantiateAttributeHolder(java.lang.String sName, java.lang.Object oValue)
sName
- the attribute nameoValue
- a non-null Object valuepublic static boolean isImmutable(java.lang.Object o)
o
- an object to check for immutability
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |