|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.script.AbstractScriptEngine
php.java.script.SimplePhpScriptEngine
abstract class SimplePhpScriptEngine
This class implements the ScriptEngine.
InvocablePhpScriptEngine,
PhpScriptEngine| Field Summary | |
|---|---|
protected HttpProxy |
continuation
The continuation of the script |
protected IContextFactory |
ctx
|
protected java.util.Map |
env
|
protected java.lang.String |
name
|
protected static java.util.HashMap |
processEnvironment
|
protected ResultProxy |
resultProxy
|
protected PhpProcedureProxy |
script
The allocated script |
protected java.lang.Object |
scriptClosure
|
| Fields inherited from interface javax.script.ScriptEngine |
|---|
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME |
| Constructor Summary | |
|---|---|
SimplePhpScriptEngine()
Create a new ScriptEngine with a default context. |
|
SimplePhpScriptEngine(PhpScriptEngineFactory factory)
Create a new ScriptEngine from a factory. |
|
| Method Summary | |
|---|---|
void |
close()
Release the script engine. |
Bindings |
createBindings()
Retrieves an uninitailized namespace which can be used as the scope of the ScriptEngine. |
protected PhpProcedureProxy |
doEval(java.io.Reader reader,
ScriptContext context)
|
java.lang.Object |
eval(java.io.Reader reader,
ScriptContext context)
Evaluates a script obtained using the specified reader as the script source and using the namespaces in the specifed ScriptContext. |
protected java.lang.Object |
eval(java.io.Reader reader,
ScriptContext context,
java.lang.String name)
|
java.lang.Object |
eval(java.lang.String script,
ScriptContext context)
Evaluates a script using the namespaces in the specifed ScriptContext. |
protected HttpProxy |
getContinuation(java.io.Reader reader,
ScriptContext context)
|
ScriptEngineFactory |
getFactory()
Retrieves a ScriptEngineFactory for the class to which describes the underlying ScriptEngine. |
protected ScriptContext |
getPhpScriptContext()
|
(package private) static java.util.HashMap |
getProcessEnvironment()
Get the current process environment which will be passed to the sub-process. |
protected void |
initialize()
|
void |
release()
Release the continuation |
protected void |
setName(java.lang.String name)
|
protected void |
setNewContextFactory()
Create a new context ID and a environment map which we send to the client. |
protected void |
setStandardEnvironmentValues(java.util.Map env)
Set the context id (X_JAVABRIDGE_CONTEXT) and the override flag (X_JAVABRIDGE_OVERRIDE_HOSTS) into env |
| Methods inherited from class javax.script.AbstractScriptEngine |
|---|
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PhpProcedureProxy script
protected java.lang.Object scriptClosure
protected java.lang.String name
protected HttpProxy continuation
protected java.util.Map env
protected IContextFactory ctx
protected ResultProxy resultProxy
protected static final java.util.HashMap processEnvironment
| Constructor Detail |
|---|
public SimplePhpScriptEngine()
public SimplePhpScriptEngine(PhpScriptEngineFactory factory)
factory - The factorygetFactory()| Method Detail |
|---|
protected void initialize()
static java.util.HashMap getProcessEnvironment()
To add custom environment variables (such as PATH=... or LD_ASSUME_KERNEL=2.4.21, ...),
use a custom PhpScriptEngine, for example:
public class MyPhpScriptEngine extends PhpScriptEngine {
protected HashMap getProcessEnvironment() {
HashMap map = new HashMap();
map.put("PATH", "/usr/local/bin");
return map;
}
}
protected void setName(java.lang.String name)
protected void setStandardEnvironmentValues(java.util.Map env)
env - the environment which will be passed to PHPprotected void setNewContextFactory()
protected java.lang.Object eval(java.io.Reader reader,
ScriptContext context,
java.lang.String name)
throws ScriptException
ScriptException
public java.lang.Object eval(java.io.Reader reader,
ScriptContext context)
throws ScriptException
ScriptEngine
reader - the script sourcecontext - the context contianing different namespace for
script evaluation
ScriptException - if an error occurs
protected HttpProxy getContinuation(java.io.Reader reader,
ScriptContext context)
protected PhpProcedureProxy doEval(java.io.Reader reader,
ScriptContext context)
throws java.lang.Exception
java.lang.Exception
public java.lang.Object eval(java.lang.String script,
ScriptContext context)
throws ScriptException
ScriptEngine
script - the String representation of the scriptcontext - tbe ScriptContext containing namespaces for the
script evaluation
ScriptException - if an error occurspublic ScriptEngineFactory getFactory()
ScriptEngine
protected ScriptContext getPhpScriptContext()
public void release()
public Bindings createBindings()
public void close()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||