|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IContextFactory
Interface that the ContextFactories must implement.
| 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 target)
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 |
removeOrphaned()
Removes the unused context factory from the classloader's list of context factories. |
void |
setContext(IContext context)
Set the Context into this factory. |
void |
waitFor()
Wait until this context is finished. |
| Method Detail |
|---|
void recycle(java.lang.String id)
throws java.lang.SecurityException
When 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.
id - The fresh id
java.lang.NullPointerException - if the current id is not initialized
java.lang.SecurityException - if the found ContextFactory is initialized.recycle(ContextFactory),
JavaBridge.recycle()void recycle(ContextFactory target)
target.accept(this).
target - The persistent ContextFactory.recycle(String),
ContextFactory.accept(IContextFactoryVisitor),
IContextFactoryVisitor.visit(ContextFactory),
SimpleContextFactoryvoid destroy()
void removeOrphaned()
void waitFor()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionContextRunnerjava.lang.String getId()
IContext getContext()
SimpleContextFactory.getContext(),
Contextvoid setContext(IContext context)
context - ContextFactory.addNew(String)JavaBridge getBridge()
ISession getSession(java.lang.String name,
boolean clientIsNew,
int timeout)
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 | |||||||||