php.java.bridge
Class SessionFactory

java.lang.Object
  extended by php.java.bridge.JavaBridgeFactory
      extended by php.java.bridge.SessionFactory
All Implemented Interfaces:
IJavaBridgeFactory
Direct Known Subclasses:
ContextFactory, RemoteHttpContextFactory

public class SessionFactory
extends JavaBridgeFactory

Create new session instances

Author:
jostb
See Also:
Session, Context, HttpContext, ContextFactory, ServletContextFactory, PhpScriptContextFactory

Field Summary
static long TIMER_DURATION
          Check for expired sessions or contexts every 10 minutes
 
Constructor Summary
SessionFactory()
           
 
Method Summary
static void destroyTimer()
          Only for internal use
 void flushBuffer()
          Flush the response buffer
 IContext getContext()
          Return the associated context
 ISession getSession(java.lang.String name, short clientIsNew, int timeout)
          Return a session.
 void invalidate()
          Hook is called at the end of the life cycle.
 
Methods inherited from class php.java.bridge.JavaBridgeFactory
destroy, getBridge, isNew, parseHeader, recycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMER_DURATION

public static final long TIMER_DURATION
Check for expired sessions or contexts every 10 minutes

See Also:
Constant Field Values
Constructor Detail

SessionFactory

public SessionFactory()
Method Detail

getSession

public ISession getSession(java.lang.String name,
                           short clientIsNew,
                           int timeout)
Return a session.

Specified by:
getSession in interface IJavaBridgeFactory
Specified by:
getSession in class JavaBridgeFactory
Parameters:
name - The session name. If name is null, the name PHPSESSION will be used.
clientIsNew - one of ISession.SESSION_CREATE_NEW ISession.SESSION_GET_OR_CREATE or ISession.SESSION_GET
timeout - timeout in seconds. If 0 the session does not expire.
Returns:
The session
See Also:
ISession

getContext

public IContext getContext()
Return the associated context

Specified by:
getContext in interface IJavaBridgeFactory
Specified by:
getContext in class JavaBridgeFactory
Returns:
Always null
See Also:
ContextFactory.getContext()

destroyTimer

public static final void destroyTimer()
Only for internal use


flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Flush the response buffer

Throws:
java.io.IOException

invalidate

public void invalidate()
Hook is called at the end of the life cycle. Either from destroy(), recycle() or from destroyOrphaned().

See Also:
IJavaBridgeFactory.destroy(), IJavaBridgeFactory.recycle()