|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectphp.java.bridge.http.Context
public class Context
Emulates a JSR223 script context when the JSR223 classes are not available.
The method call(kont) returns false, so that it can be used to check if a script was called from java:
function toString() {return "hello java, I am a php script, but in your eyes I am an ordinary java object...";}
java_context()->call(java_closure()) || die("This script must be called from java!");
IPhpScriptContext
,
ScriptContext
,
PhpSimpleHttpScriptContext
,
PhpScriptContext
Field Summary |
---|
Fields inherited from interface php.java.bridge.http.IContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE, JAVA_BRIDGE, SERVLET, SERVLET_CONFIG, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE |
Method Summary | |
---|---|
boolean |
call(PhpProcedureProxy kont)
Call the java continuation with the current continuation kont as its argument. |
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. |
java.lang.Object |
getHttpServletRequest()
|
java.lang.Object |
getHttpServletResponse()
|
java.lang.Object |
getServletContext()
|
java.io.Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
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 name,
java.lang.Object value,
int scope)
Sets an attribute specified by the name in specified level of scope. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
IContext
getAttribute
in interface IContext
name
- the name of the attribute
java.lang.IllegalArgumentException
public java.lang.Object getAttribute(java.lang.String name, int scope) throws java.lang.IllegalArgumentException
IContext
getAttribute
in interface IContext
name
- the name of the attributescope
- the level of scope
java.lang.IllegalArgumentException
public int getAttributesScope(java.lang.String name)
IContext
getAttributesScope
in interface IContext
name
- the name of attribute
public java.io.Writer getWriter() throws java.io.IOException
IContext
getWriter
in interface IContext
java.io.IOException
public java.lang.Object removeAttribute(java.lang.String name, int scope) throws java.lang.IllegalArgumentException
IContext
removeAttribute
in interface IContext
name
- the name of the attributescope
- the level of scope
java.lang.IllegalArgumentException
public void setAttribute(java.lang.String name, java.lang.Object value, int scope) throws java.lang.IllegalArgumentException
IContext
setAttribute
in interface IContext
name
- the name of the attributevalue
- the value of the attributescope
- the level of the scope
java.lang.IllegalArgumentException
public java.lang.Object getHttpServletRequest()
public java.lang.Object getServletContext()
public java.lang.Object getHttpServletResponse()
public boolean call(PhpProcedureProxy kont)
Invocable
kont
as its argument.
call
in interface Invocable
kont
- The continuation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |