|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.bridge.JavaBridgeFactory php.java.bridge.SessionFactory php.java.bridge.http.RemoteHttpContextFactory
public class RemoteHttpContextFactory
Create session contexts for servlets.
This ContextFactory can be used in environments where no custom class loaders and no threads are allowed.
ContextFactory
,
ContextServer
,
Serialized FormField Summary |
---|
Fields inherited from class php.java.bridge.SessionFactory |
---|
TIMER_DURATION |
Constructor Summary | |
---|---|
RemoteHttpContextFactory(HttpRequest req,
HttpResponse res)
|
Method Summary | |
---|---|
static IContextFactory |
addNew(HttpRequest req,
HttpResponse res,
IContextFactoryVisitor impl)
Create and add a new ContextFactory. |
void |
destroy()
Destroy the factory |
void |
flushBuffer()
Flush the response buffer |
IContext |
getContext()
Return the associated context |
java.lang.String |
getId()
Return the serializable ID of the context factory |
ISession |
getSimpleSession(java.lang.String name,
short clientIsNew,
int timeout)
|
void |
initialize()
Called when the context runner starts |
void |
invalidate()
Hook is called at the end of the life cycle. |
void |
parseHeader(Request req,
java.io.InputStream in)
Called for the request header |
void |
recycle(java.lang.String id)
Update the context factory with the new JavaBridge obtained from the servlet |
void |
release()
Releases the context factory. |
void |
releaseManaged()
Wait until this context is finished and release/destroy it. |
void |
setContext(IContext context)
Set the Context into this factory. |
void |
setResponse(HttpResponse out)
Set the current response |
void |
waitFor(long timeout)
Wait until this context is finished. |
Methods inherited from class php.java.bridge.SessionFactory |
---|
destroyTimer, getSession |
Methods inherited from class php.java.bridge.JavaBridgeFactory |
---|
getBridge, isNew, recycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface php.java.bridge.http.IContextFactory |
---|
getSession |
Methods inherited from interface php.java.bridge.IJavaBridgeFactory |
---|
getBridge, isNew, recycle |
Constructor Detail |
---|
public RemoteHttpContextFactory(HttpRequest req, HttpResponse res)
Method Detail |
---|
public static IContextFactory addNew(HttpRequest req, HttpResponse res, IContextFactoryVisitor impl)
req
- The HttpRequestres
- The HttpResponse
public java.lang.String getId()
getId
in interface IContextFactory
public void initialize()
initialize
in interface IContextFactory
IContextFactory.releaseManaged()
,
IJavaBridgeFactory.destroy()
public void invalidate()
invalidate
in interface IJavaBridgeFactory
invalidate
in class SessionFactory
IJavaBridgeFactory.destroy()
,
IJavaBridgeFactory.recycle()
public void recycle(java.lang.String id)
Update the context factory with the new JavaBridge obtained from the servlet
recycle
in interface IContextFactory
id
- The fresh idContextFactory.recycle()
,
Request.setBridge(php.java.bridge.JavaBridge)
,
Request.recycle()
public void release()
release
in interface IContextFactory
public void releaseManaged() throws java.lang.InterruptedException
releaseManaged
in interface IContextFactory
java.lang.InterruptedException
ContextRunner
public void waitFor(long timeout) throws java.lang.InterruptedException
waitFor
in interface IContextFactory
timeout
- The timeout
java.lang.InterruptedException
ContextRunner
public void parseHeader(Request req, java.io.InputStream in) throws java.io.IOException
parseHeader
in interface IJavaBridgeFactory
parseHeader
in class JavaBridgeFactory
req
- the current requestin
- the input stream
java.io.IOException
public void setContext(IContext context)
setContext
in interface IContextFactory
ContextFactory.addNew()
public IContext getContext()
getContext
in interface IContextFactory
getContext
in interface IJavaBridgeFactory
getContext
in class SessionFactory
ContextFactory.getContext()
public void destroy()
destroy
in interface IJavaBridgeFactory
destroy
in class JavaBridgeFactory
public void flushBuffer() throws java.io.IOException
flushBuffer
in interface IJavaBridgeFactory
flushBuffer
in class SessionFactory
java.io.IOException
public void setResponse(HttpResponse out)
out
- the PhpJavaServlet responsepublic ISession getSimpleSession(java.lang.String name, short clientIsNew, int timeout)
getSimpleSession
in interface IContextFactory
name
- The session name. If name is null, the name PHPSESSION will be used.clientIsNew
- true if the client wants a new sessiontimeout
- timeout in seconds. If 0 the session does not expire.
ISession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |