Package CiaoJava

This package includes all of the classes needed to use both Java-to-Prolog and Prolog-to-Java interfaces.

See:
          Description

Class Summary
PLAtom Prolog atom representation.
PLConnection Class for managing communication to Prolog.
PLFloat This class represents the Prolog floats.
PLGoal This class Represents a Prolog goal to be evaluated on a given PLConnection.
PLInteger Prolog integer representation.
PLJavaServer This class implements the starting point of the server of Java objects to Prolog.
PLList Java representation of a Prolog list.
PLServerSocket This class creates a server socket and keeps it listening at socket port #5000 (or number given in constructor).
PLString This class implements the Java representation of a Prolog string.
PLStructure This class is used to represent in Java the Prolog compound terms.
PLTerm Java representation of Prolog terms.
PLVariable Prolog variables representation.
 

Exception Summary
PLException This class implements the exceptions that can be thrown using the CiaoJava package, and translates the exceptions received from the Prolog side.
PLGoalException This class implements the exceptions that can throw when a goal is launched to be evaluated by the prolog process.
 

Package CiaoJava Description

This package includes all of the classes needed to use both Java-to-Prolog and Prolog-to-Java interfaces. These interfaces are designed to work in a client/server mode, so one side process (Java or Prolog) listens performs requests from the other side. However, in the internal socket connection the Java process allways works as socket server (even when it will behave as a logical client), until the communication to Prolog be established. Then, the interface works as an usual client/server system, where the server is basically a endless loop until it receives a termination request. Is under development the integration between the two interfaces in a bidirectional interface where both processes will be listening each other.

The package is composed of several types of classes: Prolog data types representation classes (PLAtom, PLFloat, PLInteger, PLList, PLString, PLStructure, PLVariable, and the abstract class PLTerm); Prolog execution model classes (PLConnection and PLGoal); Java interface exceptions (PLException and PLGoalException); and other classes (PLEventListener for Java event handling, PLJavaServer to implement the Java object server in the Prolog-to-Java interface, and PLJavaObjServer that represents the internal Java object server.)

Using the Prolog-to-Java interface, one should not need to know anything about this implementation classes to launch the Java object server, except PLJavaServer. This class includes itself a main() method in order to be launched in standalone mode. This method can be called also from initialization code to do the startup work before the Java object server can process Prolog requests.

In the other hand, with the Java-to-Prolog interface, Prolog data representation classes and Prolog execution model classes must be known in order to handle the data and execution structures related to the Prolog side of the interface. Specifically, before any Prolog processing can be done, a PLConnection object must be created, using the appropriate constructor (CiaoJava.PLConnection#PLConnection(Java.lang.String)). Once a Prolog connection has been established, Prolog goals can be created and launched using the PLConnection.query(CiaoJava.PLTerm) method, or creating a new PLGoal object.