php.java.script
Class Continuation

java.lang.Object
  extended by php.java.script.Continuation
All Implemented Interfaces:
java.lang.Runnable, IContinuation
Direct Known Subclasses:
CGIRunner, FastCGIProxy, HttpFastCGIProxy

public abstract class Continuation
extends java.lang.Object
implements IContinuation, java.lang.Runnable

This class represents the logic to run PHP scripts through CGI, FastCGI or on a remote HTTP server (accessed through URLReader).

Author:
jostb
See Also:
HttpServer, URLReader, HttpProxy

Method Summary
 void call(java.lang.Object script)
          The PHP script must call this function with the current continuation as an argument.
 java.lang.Object getPhpScript()
          One must call this function if one is interested in the php continuation.
 void release()
          This function must be called to release the allocated php continuation.
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

call

public void call(java.lang.Object script)
          throws java.lang.InterruptedException
The PHP script must call this function with the current continuation as an argument.

Example:

java_context()->call(java_closure());

Specified by:
call in interface IContinuation
Parameters:
script - - The php continuation
Throws:
java.lang.InterruptedException

getPhpScript

public java.lang.Object getPhpScript()
                              throws java.lang.Exception
One must call this function if one is interested in the php continuation.

Specified by:
getPhpScript in interface IContinuation
Returns:
The php continuation.
Throws:
java.lang.Exception

release

public void release()
             throws java.lang.InterruptedException
This function must be called to release the allocated php continuation. Note that simply calling this method does not guarantee that the script is finished, as the ContextRunner may still produce output. Use contextFactory.waitFor() to wait for the script to terminate.

Specified by:
release in interface IContinuation
Throws:
java.lang.InterruptedException