|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.bridge.http.SimpleContextFactory
public class SimpleContextFactory
Base of a set of visitors which can extend the standard ContextFactory. Instances of this class are thrown away at the end of the request.
ServletContextFactory
,
PhpScriptContextFactory
Method Summary | |
---|---|
void |
destroy()
Destroy the factory |
void |
flushBuffer()
Flush the response buffer |
JavaBridge |
getBridge()
Return the JavaBridge. |
IContext |
getContext()
Return a JSR223 context |
java.lang.String |
getId()
Return the serializable ID of the context factory |
ISession |
getSession(java.lang.String name,
short clientIsNew,
int timeout)
Return a session for the JavaBridge |
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. |
boolean |
isNew()
Return true if this factory has already created a bridge or not. |
void |
parseHeader(Request req,
java.io.InputStream in)
Called for the request header |
void |
recycle()
Called by recycle at the end of the script |
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 for the context factory to finish, then release |
void |
setContext(IContext context)
Set the Context into this factory. |
java.lang.String |
toString()
|
void |
visit(IContextFactory visited)
Called when a visitor has been attached. |
void |
waitFor(long timeout)
Wait for the context factory to finish. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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 destroy()
destroy
in interface IJavaBridgeFactory
public void invalidate()
invalidate
in interface IJavaBridgeFactory
IJavaBridgeFactory.destroy()
,
IJavaBridgeFactory.recycle()
public void initialize()
initialize
in interface IContextFactory
IContextFactory.releaseManaged()
,
IJavaBridgeFactory.destroy()
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 java.lang.String getId()
getId
in interface IContextFactory
public java.lang.String toString()
toString
in class java.lang.Object
public IContext getContext()
getContext
in interface IContextFactory
getContext
in interface IJavaBridgeFactory
getContext()
,
Context
public boolean isNew()
isNew
in interface IJavaBridgeFactory
public JavaBridge getBridge()
getBridge
in interface IJavaBridgeFactory
public void visit(IContextFactory visited)
visit
in interface IContextFactoryVisitor
visited
- The context factorypublic ISession getSession(java.lang.String name, short clientIsNew, int timeout)
getSession
in interface IContextFactory
getSession
in interface IJavaBridgeFactory
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
public 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
public void setContext(IContext context)
setContext
in interface IContextFactory
ContextFactory.addNew()
public void release()
release
in interface IContextFactory
public void recycle()
recycle
in interface IJavaBridgeFactory
public void flushBuffer() throws java.io.IOException
flushBuffer
in interface IJavaBridgeFactory
java.io.IOException
public void parseHeader(Request req, java.io.InputStream in) throws java.io.IOException
parseHeader
in interface IJavaBridgeFactory
req
- the current requestin
- the input stream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |