se.sics.jasper
Class Jasper

java.lang.Object
  extended by se.sics.jasper.Jasper

public class Jasper
extends java.lang.Object

This class provides the multi threaded functionality of the Java-Prolog interface. The User's Manual documents how to use this class.

The interfaces Prolog, Query and Term declare the methods available to the Java programmer for access to SICStus runtime.


Method Summary
static Prolog getCaller()
          Returns the Prolog interface corresponding to the SICStus runtime that called us.
static void main(java.lang.String[] argv)
          This is a small test function.
static Prolog newProlog()
          Creates a Prolog interface object.
static Prolog newProlog(java.lang.String bootPath)
          Creates a Prolog interface object.
static Prolog newProlog(java.lang.String[] argv, java.lang.String bootPath, java.lang.String savFile)
          Creates a Prolog interface object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCaller

public static Prolog getCaller()
Returns the Prolog interface corresponding to the SICStus runtime that called us. If Java is the toplevel, this method returns null,


newProlog

public static Prolog newProlog()
                        throws java.lang.InterruptedException
Creates a Prolog interface object. Equivalent to newProlog(null, null, null).

Throws:
java.lang.InterruptedException

newProlog

public static Prolog newProlog(java.lang.String bootPath)
                        throws java.lang.InterruptedException
Creates a Prolog interface object. Equivalent to newProlog(null, bootPath, null).

Parameters:
bootPath - The path where SICStus should look for its start-up files.
Throws:
java.lang.InterruptedException

newProlog

public static Prolog newProlog(java.lang.String[] argv,
                               java.lang.String bootPath,
                               java.lang.String savFile)
                        throws java.lang.InterruptedException
Creates a Prolog interface object. Starts a server thread which will serve that Prolog. The server thread takes care of all interaction with the Prolog runtime, making sure that all calls to the Prolog runtime will be done from one and the same thread.

Parameters:
argv - Argument vector to the emulator.
bootPath - The path where SICStus should look for its start-up files.
savFile - A .sav-file to restore. See SICStus.restore(java.lang.String)
Throws:
java.lang.InterruptedException

main

public static void main(java.lang.String[] argv)
This is a small test function. It will try to load Jasper by creating a Jasper object and prints a message if it succeeded.