com.caucho.quercus.lib.session
Class ProSessionManager

java.lang.Object
  extended by com.caucho.quercus.lib.session.QuercusSessionManager
      extended by com.caucho.quercus.lib.session.ProSessionManager
All Implemented Interfaces:
ObjectManager, AlarmListener, java.util.EventListener

public class ProSessionManager
extends QuercusSessionManager
implements ObjectManager

Stripped down version of com.caucho.server.session.SessionManager, customized to PHP instead of J2EE sessions.


Field Summary
protected static L10N L
           
protected static java.util.logging.Logger log
           
 
Fields inherited from class com.caucho.quercus.lib.session.QuercusSessionManager
_isClosed, _sessionCreateCount, _sessionIter, _sessionList, _sessionMax, _sessions, _sessionTimeoutCount, _statisticsLock
 
Constructor Summary
ProSessionManager(java.lang.String contextId)
           
 
Method Summary
 ClusterObject createClusterObject(java.lang.String id)
          Creates the cluster object
 java.lang.String createSessionId(Env env)
          Creates a pseudo-random session id.
protected  SessionArrayValue createSessionValue(java.lang.String key, long now, long sessionTimeout)
          Creates a new SessionArrayValue instance.
 long getMaxIdleTime()
          Returns the maximum idle time.
 boolean isEmpty(java.lang.Object obj)
          Checks if the session is empty.
 void load(java.io.InputStream in, java.lang.Object obj)
          Loads the session.
 void notifyRemove(java.lang.Object id)
          Notification from the cluster.
 void notifyUpdate(java.lang.Object id)
          Notification from the cluster.
 void store(java.io.OutputStream out, java.lang.Object obj)
          Saves the session.
 
Methods inherited from class com.caucho.quercus.lib.session.QuercusSessionManager
close, create, createSession, getActiveSessionCount, getReuseSessionId, getSaveOnlyOnShutdown, getSession, getSessionCreateCount, getSessionMax, getSessionTimeoutCount, handleAlarm, isClosed, load, load, notifyRemove, notifyUpdate, remove, removeSession, saveSession, setAlwaysLoadSession, setAlwaysSaveSession, setCookieAppendServerIndex, setCookieLength, setReuseSessionId, setSaveOnlyOnShutdown, setSaveOnShutdown, setSessionMax, setSessionTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

protected static final L10N L

log

protected static final java.util.logging.Logger log
Constructor Detail

ProSessionManager

public ProSessionManager(java.lang.String contextId)
Method Detail

createSessionId

public java.lang.String createSessionId(Env env)
Creates a pseudo-random session id. If there's an old id and the group matches, then use it because different applications on the same matchine should use the same cookie.

Overrides:
createSessionId in class QuercusSessionManager

createSessionValue

protected SessionArrayValue createSessionValue(java.lang.String key,
                                               long now,
                                               long sessionTimeout)
Creates a new SessionArrayValue instance.

Overrides:
createSessionValue in class QuercusSessionManager

createClusterObject

public ClusterObject createClusterObject(java.lang.String id)
Creates the cluster object

Specified by:
createClusterObject in interface ObjectManager

getMaxIdleTime

public long getMaxIdleTime()
Description copied from interface: ObjectManager
Returns the maximum idle time.

Specified by:
getMaxIdleTime in interface ObjectManager

load

public void load(java.io.InputStream in,
                 java.lang.Object obj)
          throws java.io.IOException
Loads the session.

Specified by:
load in interface ObjectManager
Parameters:
in - the input stream containing the serialized session
obj - the session object to be deserialized
Throws:
java.io.IOException

isEmpty

public boolean isEmpty(java.lang.Object obj)
Checks if the session is empty.

Specified by:
isEmpty in interface ObjectManager
Overrides:
isEmpty in class QuercusSessionManager

notifyRemove

public void notifyRemove(java.lang.Object id)
Notification from the cluster.

Specified by:
notifyRemove in interface ObjectManager

notifyUpdate

public void notifyUpdate(java.lang.Object id)
Notification from the cluster.

Specified by:
notifyUpdate in interface ObjectManager

store

public void store(java.io.OutputStream out,
                  java.lang.Object obj)
           throws java.io.IOException
Saves the session.

Specified by:
store in interface ObjectManager
Overrides:
store in class QuercusSessionManager
Throws:
java.io.IOException