|
||||||||||
| 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,
php.java.faces.PhpFacesScriptContextFactory| Method Summary | |
|---|---|
void |
destroy()
Removes the context factory from the classloader's list of context factories and destroys its content. |
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,
boolean clientIsNew,
int timeout)
|
void |
recycle(ContextFactory visited)
Typically the visitor implements this method, it should attach itself to the target by calling target.accept(this). |
void |
recycle(java.lang.String id)
Synchronize the current state with id. |
void |
remove()
Deprecated. Use destroy() instead |
void |
removeOrphaned()
Removes the unused context factory from the classloader's list of context factories. |
void |
setBridge(JavaBridge bridge)
|
void |
setContext(IContext context)
Set the Context into this factory. |
java.lang.String |
toString()
|
void |
visit(ContextFactory visited)
Called when a visitor has been attached. |
void |
waitFor()
Wait until this context is finished. |
| 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
IContextFactoryWhen persistent connections are used, the bridge instances recycle their context factories (persistent php clients store their context id, so that they don't have to aquire a new one). However, a client of a php client may have passed a fresh context id. If this happened, the bridge calls this method, which may update the current context with the fresh values from id.
Typically the ContextFactory implements this method. It should find the ContextFactory for id, check that the Factory is not in use (and throw a SecurityException, if isInitialized() returns true), remove it by calling removeOrphaned() and call its recycle() method passing it the current ContextFactory.
recycle in interface IContextFactoryid - The fresh id
java.lang.SecurityException - if the found ContextFactory is initialized.IContextFactory.recycle(ContextFactory),
JavaBridge.recycle()public void destroy()
IContextFactory
destroy in interface IContextFactory
public void waitFor()
throws java.lang.InterruptedException
IContextFactory
waitFor in interface IContextFactoryjava.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 void setBridge(JavaBridge bridge)
public JavaBridge getBridge()
IContextFactory
getBridge in interface IContextFactorypublic 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)
IContextFactorytarget.accept(this).
recycle in interface IContextFactoryvisited - The persistent ContextFactory.IContextFactory.recycle(String),
ContextFactory.accept(IContextFactoryVisitor),
IContextFactoryVisitor.visit(ContextFactory),
SimpleContextFactorypublic void removeOrphaned()
IContextFactory
removeOrphaned in interface IContextFactorypublic void remove()
destroy() instead
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||