|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphp.java.script.PhpScriptContextDecorator
public abstract class PhpScriptContextDecorator
Abstract class for IPhpScriptContexts. The abstract class itself provides default methods that pass all requests to the contained IPhpScriptContext. Subclasses of PhpScriptContextDecoratorDecorator should override some of these methods and may also provide additional methods and fields.
| 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 | |
|---|---|
PhpScriptContextDecorator(IPhpScriptContext ctx)
Create a new PhpScriptContextDecorator |
|
| Method Summary | |
|---|---|
boolean |
call(java.lang.Object kont)
Call the java continuation with the current continuation kont as its argument. |
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 |
java.lang.Object |
getAttribute(java.lang.String name)
Retrieves the value for getAttribute(String, int) for the lowest scope in which it returns a non-null value. |
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
Retrieves the value associated with specified name in the specified level of scope. |
int |
getAttributesScope(java.lang.String name)
Retrieves the lowest value of scopes for which the attribute is defined. |
Bindings |
getBindings(int scope)
Retrieves the Namespace instance associated with the gieve scope. |
ContextServer |
getContextServer()
Get the context server associated with this context, usually a HttpServer (JavaBridgeRunner) or a ContextServer from a ContextLoaderListener |
Continuation |
getContinuation()
Get the php continuation |
java.io.Writer |
getErrorWriter()
Returns the Writer used to display error output. |
java.lang.Object |
getHttpServletRequest()
Return the http servlet request |
java.lang.Object |
getHttpServletResponse()
Return the http servlet response |
java.io.Reader |
getReader()
Returns a Reader to be used by the script to read
input. |
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.util.List |
getScopes()
Returns immutable List of all the valid values for
scope in the ScriptContext. |
java.lang.Object |
getServlet()
Return the http servlet |
java.lang.Object |
getServletConfig()
Return the servlet config |
java.lang.Object |
getServletContext()
Return the servlet context |
java.lang.String |
getSocketName()
Return the socket name, for example 8080 |
java.io.Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
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 |
java.lang.Object |
removeAttribute(java.lang.String name,
int scope)
Removes the specified attribute form the specified level of scope. |
void |
setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
Sets an attribute specified by the name in specified level of scope. |
void |
setBindings(Bindings namespace,
int scope)
Associates the specified namespace with the specified scope. |
void |
setContinuation(Continuation kont)
Set the php continuation |
void |
setErrorWriter(java.io.Writer writer)
Sets the Writer used to display error output. |
void |
setReader(java.io.Reader reader)
Sets the Reader for scripts to read input
. |
void |
setWriter(java.io.Writer writer)
Sets the Writer for scripts to use when displaying output. |
void |
startContinuation()
Start the current continuation using a context-specific thread pool |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PhpScriptContextDecorator(IPhpScriptContext ctx)
ctx - the PhpScriptContext to decorate.| Method Detail |
|---|
public java.lang.Object getAttribute(java.lang.String name)
throws java.lang.IllegalArgumentException
getAttribute in interface ScriptContextgetAttribute in interface IContextname - the name of the attribute
java.lang.IllegalArgumentException - if the name is null
public java.lang.Object getAttribute(java.lang.String name,
int scope)
throws java.lang.IllegalArgumentException
getAttribute in interface ScriptContextgetAttribute in interface IContextname - the name of the attributescope - the level of scope
java.lang.IllegalArgumentException - if the name is null or the
scope is invalidpublic int getAttributesScope(java.lang.String name)
getAttributesScope in interface ScriptContextgetAttributesScope in interface IContextname - the name of attribute
public Bindings getBindings(int scope)
getBindings in interface ScriptContextscope - the level of the scope
public java.io.Writer getErrorWriter()
Writer used to display error output.
getErrorWriter in interface ScriptContextWriterpublic java.io.Reader getReader()
Reader to be used by the script to read
input.
getReader in interface ScriptContextReader.public java.util.List getScopes()
List of all the valid values for
scope in the ScriptContext.
getScopes in interface ScriptContextpublic java.io.Writer getWriter()
getWriter in interface ScriptContextgetWriter in interface IContext
public java.lang.Object removeAttribute(java.lang.String name,
int scope)
throws java.lang.IllegalArgumentException
removeAttribute in interface ScriptContextremoveAttribute in interface IContextname - the name of the attributescope - the level of scope
java.lang.IllegalArgumentException - if the name is null or if the
scope is invalid
public void setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
throws java.lang.IllegalArgumentException
setAttribute in interface ScriptContextsetAttribute in interface IContextkey - the name of the attributevalue - the value of the attributescope - the level of the scope
java.lang.IllegalArgumentException - if the name is null scope is
invlaid
public void setBindings(Bindings namespace,
int scope)
throws java.lang.IllegalArgumentException
setBindings in interface ScriptContextnamespace - the namespace to be associated with the
specified level of scopescope - the specified level of scope
java.lang.IllegalArgumentException - if the scope is invalidpublic void setErrorWriter(java.io.Writer writer)
Writer used to display error output.
setErrorWriter in interface ScriptContextwriter - The Writer.public void setReader(java.io.Reader reader)
Reader for scripts to read input
.
setReader in interface ScriptContextreader - The new Reader.public void setWriter(java.io.Writer writer)
Writer for scripts to use when displaying output.
setWriter in interface ScriptContextwriter - The new Writer.public Continuation getContinuation()
getContinuation in interface IPhpScriptContextpublic void setContinuation(Continuation kont)
setContinuation in interface IPhpScriptContextkont - The continuation.
public java.lang.Object init(java.lang.Object callable)
throws java.lang.Exception
init in interface IManagedcallable - Its call() method will be called synchronized.
java.lang.Exception - The result of the call() invocation.public void onShutdown(java.lang.Object closeable)
onShutdown in interface IManagedcloseable - Its close() method will be called before the context or the VM terminates.
public boolean call(java.lang.Object kont)
throws java.lang.Exception
kont as its argument.
call in interface Invocablekont - The continuation.
java.lang.Exceptionpublic java.lang.Object get(java.lang.String key)
get in interface IContextkey - the key
public java.util.Map getAll()
getAll in interface IContextpublic java.lang.Object getHttpServletRequest()
getHttpServletRequest in interface IContextpublic java.lang.Object getHttpServletResponse()
getHttpServletResponse in interface IContextpublic java.lang.String getRealPath(java.lang.String path)
getRealPath in interface IContextpath - the relative path to an existing resource
public java.lang.Object getServlet()
getServlet in interface IContextpublic java.lang.Object getServletConfig()
getServletConfig in interface IContextpublic java.lang.Object getServletContext()
getServletContext in interface IContext
public void put(java.lang.String key,
java.lang.Object val)
put in interface IContextkey - the keyval - the valuepublic void putAll(java.util.Map map)
putAll in interface IContextmap - the mappublic void remove(java.lang.String key)
remove in interface IContextkey - the key
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)
createContinuation in interface IPhpScriptContextreader - 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 getRedirectString(java.lang.String webPath)
getRedirectString in interface IContextpublic java.lang.String getRedirectString()
getRedirectString in interface IContextpublic java.lang.String getSocketName()
getSocketName in interface IContextpublic java.lang.String getRedirectURL(java.lang.String webPath)
getRedirectURL in interface IContextwebPath - Usually request.getContextPath()+request.getServletPath()
public ContextServer getContextServer()
getContextServer in interface IPhpScriptContextpublic void startContinuation()
startContinuation in interface IPhpScriptContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||