|
||||||||||
| 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. |
java.lang.ClassLoader |
getClassLoader()
Get the class loader from the servlet. |
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)
Return a session for the JavaBridge |
void |
recycle(java.lang.String id)
Update the context factory with the new JavaBridge obtained from the servlet. |
void |
removeOrphaned()
Removes the unused context factory from the classloader's list of context factories. |
void |
setClassLoader(java.lang.ClassLoader loader)
Set the class loader obtained from the current servlet into the context. |
void |
setContext(IContext context)
Set the Context into this factory. |
void |
waitFor()
Wait until this context is finished. |
void |
waitFor(long timeout)
Wait until this context is finished. |
| Methods inherited from interface php.java.bridge.IJavaBridgeFactory |
|---|
getBridge, getJavaBridgeClassLoader, recycle |
| Method Detail |
|---|
void recycle(java.lang.String id)
throws java.lang.SecurityException
Update 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.
id - The fresh id
java.lang.SecurityExceptionContextFactory.recycle(),
Request.setBridge(php.java.bridge.JavaBridge),
Request.recycle()void destroy()
destroy in interface IJavaBridgeFactoryvoid removeOrphaned()
void waitFor()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionContextRunner
void waitFor(long timeout)
throws java.lang.InterruptedException
timeout - The timeout
java.lang.InterruptedExceptionContextRunnerjava.lang.String getId()
IContext getContext()
getContext in interface IJavaBridgeFactorySimpleContextFactory.getContext(),
Contextvoid setContext(IContext context)
context - php.java.bridge.http.ContextFactory#addNew(String)
ISession getSession(java.lang.String name,
boolean clientIsNew,
int timeout)
IJavaBridgeFactory
getSession in interface IJavaBridgeFactoryname - 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.
ISessionvoid setClassLoader(java.lang.ClassLoader loader)
loader - The currentThreadContextClassLoaderjava.lang.ClassLoader getClassLoader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||