com.caucho.quercus.env
Class SessionArrayValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ArrayValue
          extended by com.caucho.quercus.env.ArrayValueWrapper
              extended by com.caucho.quercus.env.SessionArrayValue
All Implemented Interfaces:
CacheListener, java.io.Serializable
Direct Known Subclasses:
ResinSessionArrayValue

public class SessionArrayValue
extends ArrayValueWrapper
implements CacheListener, java.io.Serializable

Represents the $_SESSION

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.caucho.quercus.env.ArrayValue
ArrayValue.AbstractGet, ArrayValue.Entry, ArrayValue.EntryIterator, ArrayValue.EntrySet, ArrayValue.GetKey, ArrayValue.GetValue, ArrayValue.KeyComparator, ArrayValue.KeyIterator, ArrayValue.KeySet, ArrayValue.ValueCollection, ArrayValue.ValueComparator, ArrayValue.ValueIterator
 
Field Summary
protected  long _accessTime
           
protected static java.util.logging.Logger log
           
 
Fields inherited from class com.caucho.quercus.env.ArrayValue
ARRAY, GET_KEY, GET_VALUE, KEY, VALUE
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
SessionArrayValue(java.lang.String id, long now, long maxInactiveInterval)
           
SessionArrayValue(java.lang.String id, long now, long maxInactiveInterval, ArrayValue array)
           
 
Method Summary
 void addUse()
           
 Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
          Copy for serialization
 boolean decode(Env env, StringValue encoded)
          Decodes encoded values, adding them to this object.
 java.lang.String encode(Env env)
          Encoding for serialization.
 void finish()
          Cleaning up session stuff at the end of a request.
 long getAccessTime()
           
 java.lang.String getId()
          Returns the session id.
 long getMaxInactiveInterval()
           
 boolean inUse()
           
 void invalidate()
          Invalidates the session.
 boolean isEmpty()
          Returns true if the value is empty
 boolean isValid()
           
 boolean load()
           
 void load(Env env, java.io.InputStream in)
           
protected  void remove()
           
 void removeEvent()
          Callback when the session is removed from the session cache, generally because the session cache is full.
 void reset(long now)
           
 void setAccess(long now)
           
 void setId(java.lang.String id)
          Changes the session id.
 void setValid(boolean isValid)
           
protected  void store()
           
 void store(Env env, java.io.OutputStream out)
          Saves the object to the output stream.
 void storeOnShutdown()
          Store on shutdown.
 java.lang.Object toObject()
          Converts to an object.
 
Methods inherited from class com.caucho.quercus.env.ArrayValueWrapper
add, append, clear, contains, containsKey, containsStrict, copy, copySaveFunArg, createTailKey, current, each, end, get, getArg, getArray, getHead, getIterator, getKeyIterator, getSize, getTail, getValueIterator, getVar, hasCurrent, isset, key, next, pop, prev, put, put, putVar, remove, reset, shuffle, splice, unshift
 
Methods inherited from class com.caucho.quercus.env.ArrayValue
append, callCallback, callCallback, callCallback, cmp, copyReturn, entrySet, eq, eql, geq, getArray, getBaseIterator, getCount, getCountRecursive, getCurrent, getIterator, getKeyArray, getKeys, getObject, getRaw, getType, getValueArray, getValues, getValueType, gt, isArray, isCallable, jsonEncode, keyExists, keyReset, keySet, keysToArray, leq, lt, print, printREntry, printRImpl, put, put, put, put, put, put, put, put, put, put, put, putAll, serialize, setCurrent, slice, sort, toArray, toArray, toArrayValue, toAutoArray, toBinaryValueMarshalCost, toBoolean, toCallable, toCharMarshalCost, toDouble, toEntryArray, toJavaCollection, toJavaList, toJavaMap, toJavaObject, toKey, toLocalRef, toLong, toObject, toString, toStringMarshalCost, toStringValueMarshalCost, toUnicodeValueMarshalCost, values, valuesToArray, valuesToArray, varDumpEntry, varDumpImpl, varExport
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, addOne, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, copy, copyArrayItem, copyStringBuilder, copyTree, div, div, eqValue, findFunction, generate, getCallableName, getCalledClass, getClassName, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getObject, getQuercusClass, getRef, getResourceType, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, hashCode, increment, initField, isA, isA, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isObject, isResource, isset, issetField, issetThisField, isString, isUnicode, isVar, length, lshift, mod, mul, mul, neg, nextIndex, pos, postdecr, postincr, postincr, predecr, preincr, preincr, print, printDepth, printJavaChar, printJavaString, printR, put, putField, putField, putField, putObject, putThisField, putThisField, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, sub_rev, sub, sub, subOne, toArgRef, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toChar, toCharArrayMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaLong, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringValue, toStringValue, toUnicode, toUnicodeValue, toUnicodeValue, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, varDump
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

_accessTime

protected long _accessTime
Constructor Detail

SessionArrayValue

public SessionArrayValue(java.lang.String id,
                         long now,
                         long maxInactiveInterval)

SessionArrayValue

public SessionArrayValue(java.lang.String id,
                         long now,
                         long maxInactiveInterval,
                         ArrayValue array)
Method Detail

getId

public java.lang.String getId()
Returns the session id.


setId

public void setId(java.lang.String id)
Changes the session id. Used by session_regenerate_id() where we want to change the session id, but keep the rest of the session information.


toObject

public java.lang.Object toObject()
Converts to an object.

Overrides:
toObject in class ArrayValue

copy

public Value copy(Env env,
                  java.util.IdentityHashMap<Value,Value> map)
Copy for serialization

Overrides:
copy in class ArrayValueWrapper

encode

public java.lang.String encode(Env env)
Encoding for serialization.


decode

public boolean decode(Env env,
                      StringValue encoded)
Decodes encoded values, adding them to this object.


inUse

public boolean inUse()

addUse

public void addUse()

load

public boolean load()

store

public void store(Env env,
                  java.io.OutputStream out)
           throws java.io.IOException
Saves the object to the output stream.

Throws:
java.io.IOException

load

public void load(Env env,
                 java.io.InputStream in)
          throws java.io.IOException
Throws:
java.io.IOException

finish

public void finish()
Cleaning up session stuff at the end of a request.

If the session data has changed and we have persistent sessions, save the session. However, if save-on-shutdown is true, only save on a server shutdown.


storeOnShutdown

public void storeOnShutdown()
Store on shutdown.


store

protected void store()

getMaxInactiveInterval

public long getMaxInactiveInterval()

reset

public void reset(long now)

getAccessTime

public long getAccessTime()

setAccess

public void setAccess(long now)

isValid

public boolean isValid()

setValid

public void setValid(boolean isValid)

invalidate

public void invalidate()
Invalidates the session.


remove

protected void remove()

isEmpty

public boolean isEmpty()
Description copied from class: ArrayValue
Returns true if the value is empty

Overrides:
isEmpty in class ArrayValue

removeEvent

public void removeEvent()
Callback when the session is removed from the session cache, generally because the session cache is full.

Specified by:
removeEvent in interface CacheListener