php.java.servlet
Class RemoteServletContextFactory

java.lang.Object
  extended by php.java.bridge.http.SimpleContextFactory
      extended by php.java.servlet.ServletContextFactory
          extended by php.java.servlet.RemoteServletContextFactory
All Implemented Interfaces:
IContextFactory, IContextFactoryVisitor, IJavaBridgeFactory

public class RemoteServletContextFactory
extends ServletContextFactory

Create session contexts for servlets.

In addition to the standard ContextFactory this manager keeps a reference to the HttpServletRequest.

See Also:
ContextFactory, ContextServer

Method Summary
static ServletContextFactory addNew(javax.servlet.Servlet servlet, javax.servlet.ServletContext kontext, javax.servlet.http.HttpServletRequest proxy, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Create and add a new ContextFactory.
 IContext createContext()
          Return an emulated JSR223 context.
 ISession getSession(java.lang.String name, boolean clientIsNew, int timeout)
           
 void waitFor()
          Wait for the context factory to finish.
 void waitFor(long timeout)
          Wait for the context factory to finish.
 
Methods inherited from class php.java.servlet.ServletContextFactory
destroy, getSession, toString
 
Methods inherited from class php.java.bridge.http.SimpleContextFactory
finishContext, getBridge, getClassLoader, getContext, getId, recycle, recycle, recycleLegacy, remove, removeOrphaned, setClassLoader, setContext, setIsLegacyClient, visit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSession

public ISession getSession(java.lang.String name,
                           boolean clientIsNew,
                           int timeout)
Specified by:
getSession in interface IContextFactory
Overrides:
getSession in class ServletContextFactory
Parameters:
name - The session name. If name is null, the name PHPSESSION will be used.
clientIsNew - true if the client wants a new session
timeout - timeout in seconds. If 0 the session does not expire.
Returns:
The session
See Also:
ISession

addNew

public static ServletContextFactory addNew(javax.servlet.Servlet servlet,
                                           javax.servlet.ServletContext kontext,
                                           javax.servlet.http.HttpServletRequest proxy,
                                           javax.servlet.http.HttpServletRequest req,
                                           javax.servlet.http.HttpServletResponse res)
Create and add a new ContextFactory.

Parameters:
req - The HttpServletRequest
res - The HttpServletResponse
Returns:
The created ContextFactory

createContext

public IContext createContext()
Return an emulated JSR223 context.

Overrides:
createContext in class ServletContextFactory
Returns:
The context.
See Also:
Context

waitFor

public void waitFor()
             throws java.lang.InterruptedException
Wait for the context factory to finish.

Specified by:
waitFor in interface IContextFactory
Overrides:
waitFor in class SimpleContextFactory
Throws:
java.lang.InterruptedException
See Also:
ContextRunner

waitFor

public void waitFor(long timeout)
             throws java.lang.InterruptedException
Wait for the context factory to finish.

Specified by:
waitFor in interface IContextFactory
Overrides:
waitFor in class SimpleContextFactory
Parameters:
timeout - The timeout
Throws:
java.lang.InterruptedException
See Also:
ContextRunner