|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphp.java.bridge.http.SimpleContextFactory
public class SimpleContextFactory
Base of a set of visitors which can extend the standard ContextFactory.
ServletContextFactory,
PhpScriptContextFactory| Method Summary | |
|---|---|
void |
destroy()
Removes the context factory from the classloader's list of context factories and destroys its content. |
void |
finishContext()
Called by recycle at the end of the script |
JavaBridge |
getBridge()
Return an instance of the PHP/Java Bridge. |
java.lang.ClassLoader |
getClassLoader()
Return the current class loader. |
IContext |
getContext()
Return a JSR223 context |
java.lang.String |
getId()
Return the serializable ID of the context factory |
ISession |
getSession(java.lang.String name,
boolean clientIsNew,
int timeout)
|
void |
recycle(ContextFactory visited)
|
void |
recycle(java.lang.String id)
Update the context factory with the new JavaBridge obtained from the servlet. |
void |
recycleLegacy(java.lang.String id)
|
void |
remove()
Deprecated. Use destroy() instead |
void |
removeOrphaned()
Removes the unused context factory from the classloader's list of context factories. |
void |
setClassLoader(java.lang.ClassLoader loader)
Set the current class loader |
void |
setContext(IContext context)
Set the Context into this factory. |
void |
setIsLegacyClient(boolean legacyClient)
Will be called by the PhpJavaServlet and by the JavaBridgeRunner when the client is not the pure PHP client. |
java.lang.String |
toString()
|
void |
visit(ContextFactory visited)
Called when a visitor has been attached. |
void |
waitFor()
Wait for the context factory to finish. |
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)
throws java.lang.SecurityException
IContextFactoryUpdate the context factory with the new JavaBridge obtained from the servlet.
Since version 4.1.1 both, the C and the pure PHP implementation pass the context factory via a protocol header. This procedure must obtain the factory for id and pass the bridge to the current context factory. Furthermore it must update the currentThreadContextClassLoader. After the request is done, the ContextFactory#recycle() method is called, which must restore the currentThreadContextClassLoader and the old context factory.
recycle in interface IContextFactoryid - The fresh id
java.lang.SecurityExceptionContextFactory.recycle(),
Request.setBridge(php.java.bridge.JavaBridge),
Request.recycle()public void destroy()
IContextFactory
destroy in interface IContextFactory
public void waitFor()
throws java.lang.InterruptedException
waitFor in interface IContextFactoryjava.lang.InterruptedExceptionContextRunner
public void waitFor(long timeout)
throws java.lang.InterruptedException
waitFor in interface IContextFactorytimeout - The timeout
java.lang.InterruptedExceptionContextRunnerpublic java.lang.String getId()
IContextFactory
getId in interface IContextFactorypublic java.lang.String toString()
toString in class java.lang.Objectpublic IContext getContext()
IContextFactory
getContext in interface IContextFactorygetContext(),
Contextpublic JavaBridge getBridge()
IJavaBridgeFactory
getBridge in interface IJavaBridgeFactorypublic void visit(ContextFactory visited)
IContextFactoryVisitor
visit in interface IContextFactoryVisitorvisited - The context factory
public ISession getSession(java.lang.String name,
boolean clientIsNew,
int timeout)
getSession in interface IContextFactoryname - 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.
ISessionpublic void setContext(IContext context)
IContextFactory
setContext in interface IContextFactoryContextFactory.addNew(String)public void recycle(ContextFactory visited)
recycle in interface IContextFactorypublic void removeOrphaned()
IContextFactory
removeOrphaned in interface IContextFactorypublic void remove()
destroy() instead
public void finishContext()
finishContext in interface IContextFactorypublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface IContextFactorypublic void setClassLoader(java.lang.ClassLoader loader)
setClassLoader in interface IContextFactoryloader - The DynamicJavaBridgeClassLoaderpublic void setIsLegacyClient(boolean legacyClient)
IContextFactory
setIsLegacyClient in interface IContextFactory
public void recycleLegacy(java.lang.String id)
throws java.lang.SecurityException
recycleLegacy in interface IContextFactoryjava.lang.SecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||