Inheritance diagram for com::declarativa::interprolog::SubprocessEngine:
Public Member Functions | |
synchronized void | addPrologOutputListener (PrologOutputListener client) |
synchronized void | removePrologOutputListener (PrologOutputListener client) |
void | addPrologStdoutListener (OutputListener l) |
void | addPrologStderrListener (OutputListener l) |
void | removePrologStdoutListener (OutputListener l) |
void | removePrologStderrListener (OutputListener l) |
SubprocessEngine (String startPrologCommand, boolean debug) | |
SubprocessEngine (String startPrologCommand) | |
boolean | isAvailable () |
synchronized void | shutdown () |
synchronized void | sendAndFlush (String s) |
void | sendAndFlushLn (String s) |
Object[] | deterministicGoal (String G, String OVar, Object[] objectsP, String RVars) |
Protected Member Functions | |
void | setupCallbackServer () |
Object | receiveObject () throws IOException |
void | sendObject (Object y) throws IOException |
boolean | isShutingDown () |
void | finalize () throws Throwable |
void | setDetectPromptAndBreak (boolean yes) |
boolean | isDetectingPromptAndBreak () |
void | prepareInterrupt (String myHost) throws IOException |
synchronized void | doInterrupt () |
boolean | realCommand (String s) |
Object[] | firstGoal (String G, String OVar, Object[] objectsP, String RVars) |
Object | doSomething () |
synchronized boolean | onlyFirstGoalSchedulled () |
void | setupErrorHandling () |
void | removeErrorHandling () |
Static Protected Member Functions | |
static boolean | needsSocketInterrupt () |
Protected Attributes | |
Socket | socket |
Package Attributes | |
Process | prolog |
PrintWriter | prologStdin |
OutputHandler | stdoutHandler |
OutputHandler | stderrHandler |
ServerSocket | serverSocket |
ServerSocket | intServerSocket = null |
Socket | intSocket = null |
String | interruptCommand = null |
Vector | listeners = new Vector () |
boolean | available |
Recognizer | promptTrigger = new Recognizer("| ?-") |
Recognizer | breakTrigger = new Recognizer(": ?-") |
Recognizer | errorTrigger = new Recognizer("++Error",true) |
Definition at line 19 of file SubprocessEngine.java.
|
Construct a SubprocessEngine, launching a Prolog process in background.
Definition at line 96 of file SubprocessEngine.java. References com::declarativa::interprolog::util::PrologOutputObjectStream::flush(), and com::declarativa::interprolog::util::PrologOutputObjectStream::getObjectStream(). |
|
Add a PrologOutputListener to this engine. All stdout and stderr output will be routed to the client.
Definition at line 45 of file SubprocessEngine.java. References addPrologStderrListener(), addPrologStdoutListener(), and listeners. |
|
Add a OutputListener to get output from Prolog's standard output. This is a lower level interface than addPrologOutputListener(PrologOutputListener).
Definition at line 69 of file SubprocessEngine.java. Referenced by addPrologOutputListener(). |
|
Synchronously calls a Prolog goal. Only the first solution is considered. G should contain a syntactically correct Prolog term, without the trailing dot (.). Throws an IPAbortedException if a Prolog abort happens, and an IPInterruptedException if the interrupt() method was invoked.
Reimplemented from com::declarativa::interprolog::PrologEngine. Definition at line 347 of file SubprocessEngine.java. |
|
return result to last javaMessage or pick more recent GoalToExecute Reimplemented from com::declarativa::interprolog::PrologEngine. Definition at line 400 of file SubprocessEngine.java. |
|
Kill the Prolog background process. If you wish to make sure this message is sent on exiting, use System.runFinalizersOnExit(true) on initialization Definition at line 264 of file SubprocessEngine.java. |
|
Very alike deterministicGoal except that it sends the initial GoalFromJava object over the socket Definition at line 364 of file SubprocessEngine.java. References com::declarativa::interprolog::util::ResultFromProlog::error, com::declarativa::interprolog::util::ResultFromProlog::rVars, com::declarativa::interprolog::util::ResultFromProlog::succeeded, and com::declarativa::interprolog::util::ResultFromProlog::timestamp. |
|
Prolog is thought to be idle Reimplemented from com::declarativa::interprolog::PrologEngine. Definition at line 177 of file SubprocessEngine.java. |
|
This implementation returns false Reimplemented from com::declarativa::interprolog::PrologEngine. Definition at line 257 of file SubprocessEngine.java. |
|
This implementation may get stuck if the command includes variables, because the Prolog top level interpreter may offer to compute more solutions; use variables prefixed with '_' Implements com::declarativa::interprolog::PrologEngine. Definition at line 341 of file SubprocessEngine.java. |
|
Sends a String to Prolog's input. Its meaning will naturally depend on the current state of Prolog: it can be a top goal, or input to an ongoing computation Definition at line 289 of file SubprocessEngine.java. |
|
Shuts down the background Prolog process as well as the dependent Java threads. Implements com::declarativa::interprolog::PrologEngine. Definition at line 229 of file SubprocessEngine.java. |