## php.java.script
Class PhpScriptContext

    java.lang.Object
      javax.script.SimpleScriptContext
          php.java.script.PhpScriptContext

All Implemented Interfaces:
  ScriptContext, Invocable, IPhpScriptContext

    public class PhpScriptContext

extends SimpleScriptContext
implements 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 interface javax.script.ScriptContext
`ENGINE_SCOPE, GLOBAL_SCOPE`

Constructor Summary
`PhpScriptContext()` Create a standalone PHP script context.

Method Summary
`boolean` `call(PhpProcedureProxy kont)` Call the java continuation with the current continuation `kont` as its argument.
`JavaBridgeRunner` `getHttpServer()` Return the http server associated with this context.
`java.io.Writer` `getWriter()` Retrieves an instance of java.io.Writer which can be used by scripts to display their output.
`void` `setContinuation(HttpProxy kont)` Set the php continuation

Methods inherited from class javax.script.SimpleScriptContext
`getAttribute, getAttribute, getAttributesScope, getBindings, removeAttribute, setAttribute, setBindings`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PhpScriptContext

    public PhpScriptContext()

  Create a standalone PHP script context.

Method Detail

### getWriter

    public java.io.Writer getWriter()

  Description copied from class: `SimpleScriptContext`
  Retrieves an instance of java.io.Writer which can be used by scripts to display their output.

  Specified by:
    `getWriter` in interface `ScriptContext`
  Specified by:
    `getWriter` in interface `IPhpScriptContext`
  Overrides:
    `getWriter` in class `SimpleScriptContext`
  Returns:
    an instance of java.io.Writer

### setContinuation

    public void setContinuation(HttpProxy kont)

  Set the php continuation

  Specified by:
    `setContinuation` in interface `IPhpScriptContext`
  Parameters:
    `kont` - - The continuation.

### call

    public boolean call(PhpProcedureProxy kont)
                 throws java.lang.InterruptedException

  Description copied from interface: `Invocable`
  Call the java continuation with the current continuation `kont` as its argument.

  Specified by:
    `call` in interface `Invocable`
  Parameters:
    `kont` - The continuation.
  Returns:
    True on success, false otherwise.
  Throws:
    `java.lang.InterruptedException`

### getHttpServer

    public JavaBridgeRunner getHttpServer()

  Description copied from interface: `IPhpScriptContext`
  Return the http server associated with this context.

  Specified by:
    `getHttpServer` in interface `IPhpScriptContext`
  Returns:
    The http server.