|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.script.ScriptContextDecorator php.java.script.AbstractPhpScriptContext php.java.script.PhpScriptContext
public final class PhpScriptContext
This class implements a simple script context for PHP. It starts a standalone
JavaBridgeRunner
which listens for requests from php instances.
In a servlet environment please use a php.java.script.http.PhpSimpleHttpScriptContext
instead.
PhpScriptContext
,
JavaBridgeRunner
Field Summary |
---|
Fields inherited from interface php.java.bridge.http.IContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE, JAVA_BRIDGE, PHP_PROCEDURE, SERVLET, SERVLET_CONFIG, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE |
Fields inherited from interface javax.script.ScriptContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE |
Constructor Summary | |
---|---|
PhpScriptContext(ScriptContext ctx)
|
Method Summary | |
---|---|
Continuation |
createContinuation(java.io.Reader reader,
java.util.Map env,
java.io.OutputStream out,
java.io.OutputStream err,
HeaderParser headerParser,
ResultProxy result,
ILogger logger,
boolean isCompiled)
Create a continuation |
java.lang.Object |
get(java.lang.String key)
Get a binding from the engine scope |
java.util.Map |
getAll()
Get all bindings from the engine scope |
ContextServer |
getContextServer()
Get the context server associated with this context, usually a HttpServer (JavaBridgeRunner) or a ContextServer from a ContextLoaderListener |
java.lang.Object |
getHttpServletRequest()
Throws IllegalStateException |
java.lang.Object |
getHttpServletResponse()
Throws IllegalStateException |
java.lang.String |
getRealPath(java.lang.String path)
Get the full file system path for the given resource. |
java.lang.String |
getRedirectString()
Deprecated. |
java.lang.String |
getRedirectString(java.lang.String webPath)
Deprecated. |
java.lang.String |
getRedirectURL(java.lang.String webPath)
Return the redirect string, for example http://localhost:8080/webPath Used by the non-compiling script engines to hard-code the back-end URL in the Java.inc |
java.lang.Object |
getServlet()
Throws IllegalStateException |
java.lang.Object |
getServletConfig()
Throws IllegalStateException |
java.lang.Object |
getServletContext()
Throws IllegalStateException |
java.lang.String |
getSocketName()
Return the socket name, for example 8080 |
java.lang.Object |
init(java.lang.Object callable)
Initialize a library. |
void |
onShutdown(java.lang.Object closeable)
Register a shutdown hook for the library. |
void |
put(java.lang.String key,
java.lang.Object val)
Add a new binding to the engine scope |
void |
putAll(java.util.Map map)
Put all bindings to the engine scope |
void |
remove(java.lang.String key)
Remove a bindings from the engine scope |
Methods inherited from class php.java.script.AbstractPhpScriptContext |
---|
call, getContinuation, getErrorWriter, getWriter, setContinuation, setErrorWriter, setWriter, startContinuation |
Methods inherited from class php.java.script.ScriptContextDecorator |
---|
getAttribute, getAttribute, getAttributesScope, getBindings, getReader, getScopes, removeAttribute, setAttribute, setBindings, setReader |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface php.java.bridge.http.IContext |
---|
getAttribute, getAttribute, getAttributesScope, removeAttribute, setAttribute |
Methods inherited from interface javax.script.ScriptContext |
---|
getAttribute, getAttribute, getAttributesScope, getBindings, getReader, getScopes, removeAttribute, setAttribute, setBindings, setReader |
Constructor Detail |
---|
public PhpScriptContext(ScriptContext ctx)
Method Detail |
---|
public java.lang.Object init(java.lang.Object callable) throws java.lang.Exception
callable
- Its call() method will be called synchronized.
java.lang.Exception
- The result of the call() invocation.public void onShutdown(java.lang.Object closeable)
closeable
- Its close() method will be called before the context or the VM terminates.public java.lang.Object getHttpServletRequest()
public java.lang.Object getServletContext()
public java.lang.Object getHttpServletResponse()
public java.lang.Object getServlet()
public java.lang.Object getServletConfig()
public java.lang.String getRealPath(java.lang.String path)
path
- the relative path to an existing resource
public java.lang.Object get(java.lang.String key)
key
- the key
public void put(java.lang.String key, java.lang.Object val)
key
- the keyval
- the valuepublic void remove(java.lang.String key)
key
- the keypublic void putAll(java.util.Map map)
map
- the mappublic java.util.Map getAll()
public Continuation createContinuation(java.io.Reader reader, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, HeaderParser headerParser, ResultProxy result, ILogger logger, boolean isCompiled)
reader
- the script readerenv
- the environment passed to phpout
- the fcgi output streamerr
- the fcgi error streamheaderParser
- fcgi header parserresult
- the result proxylogger
- the loggerisCompiled
- create a continuation for a compiled or non-compiled script engine
public java.lang.String getSocketName()
public java.lang.String getRedirectString()
public java.lang.String getRedirectString(java.lang.String webPath)
public java.lang.String getRedirectURL(java.lang.String webPath)
webPath
- Usually request.getContextPath()+request.getServletPath()
public ContextServer getContextServer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |