php.java.script
Class PhpScriptContext

java.lang.Object
  extended by javax.script.SimpleScriptContext
      extended by php.java.script.AbstractPhpScriptContext
          extended by php.java.script.PhpScriptContext
All Implemented Interfaces:
ScriptContext, IContext, Invocable, IPhpScriptContext

public class PhpScriptContext
extends AbstractPhpScriptContext
implements IContext, IPhpScriptContext

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.PhpSimpleHttpScriptContext instead.

Author:
jostb
See Also:
PhpSimpleHttpScriptContext, JavaBridgeRunner

Field Summary
 
Fields inherited from class php.java.script.AbstractPhpScriptContext
APPLICATION_SCOPE, REQUEST_SCOPE, SESSION_SCOPE
 
Fields inherited from interface php.java.bridge.http.IContext
ENGINE_SCOPE, GLOBAL_SCOPE, JAVA_BRIDGE, SERVLET, SERVLET_CONFIG, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE
 
Fields inherited from interface javax.script.ScriptContext
ENGINE_SCOPE, GLOBAL_SCOPE
 
Constructor Summary
PhpScriptContext()
          Create a standalone PHP script context.
 
Method Summary
 java.lang.String getContextString()
          Return the context string, for example http://localhost:8080/JavaBridge
 java.io.Writer getErrorWriter()
          Returns the Writer used to display error output.
 java.lang.String getSocketName()
          Return the socket name, for example 8080
 java.io.Writer getWriter()
          Returns the Writer for scripts to use when displaying output.
 
Methods inherited from class php.java.script.AbstractPhpScriptContext
call, getContinuation, setContinuation, setErrorWriter, setWriter
 
Methods inherited from class javax.script.SimpleScriptContext
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.script.IPhpScriptContext
getContinuation, setContinuation, setWriter
 
Methods inherited from interface php.java.bridge.Invocable
call
 
Methods inherited from interface php.java.bridge.http.IContext
getAttribute, getAttribute, getAttributesScope, removeAttribute, setAttribute
 

Constructor Detail

PhpScriptContext

public PhpScriptContext()
Create a standalone PHP script context.

Method Detail

getWriter

public java.io.Writer getWriter()
Description copied from class: AbstractPhpScriptContext
Returns the Writer for scripts to use when displaying output.

Specified by:
getWriter in interface ScriptContext
Specified by:
getWriter in interface IContext
Specified by:
getWriter in interface IPhpScriptContext
Overrides:
getWriter in class AbstractPhpScriptContext
Returns:
The Writer.

getErrorWriter

public java.io.Writer getErrorWriter()
Description copied from class: AbstractPhpScriptContext
Returns the Writer used to display error output.

Specified by:
getErrorWriter in interface ScriptContext
Overrides:
getErrorWriter in class AbstractPhpScriptContext
Returns:
The Writer

getSocketName

public java.lang.String getSocketName()
Description copied from class: AbstractPhpScriptContext
Return the socket name, for example 8080

Specified by:
getSocketName in interface IPhpScriptContext
Specified by:
getSocketName in class AbstractPhpScriptContext
Returns:
the socket name

getContextString

public java.lang.String getContextString()
Description copied from class: AbstractPhpScriptContext
Return the context string, for example http://localhost:8080/JavaBridge

Specified by:
getContextString in interface IPhpScriptContext
Specified by:
getContextString in class AbstractPhpScriptContext
Returns:
the context string