|
|||||||||
PREV NEXT | FRAMES NO FRAMES |
See:
Description
Packages | |
CiaoJava | This package includes all of the classes needed to use both java-to-prolog and prolog-to-java interfaces. |
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 requests from the other side. However, because these interfaces use sockets to connect java and prolog, phisically only the java side works as socket server, until the communication with prolog is established. After this, the interface works as an usual client/server system, where the server is basically a endless loop until receives a termination request. Is under development the integration between the two interfaces so the 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).
Using the prolog-to-java interface, should not be necessary to know
anything about this implementation classes, except
PLJavaServer
, to launch the java object server. This class
includes itself a main()
method 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 (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.
|
|||||||||
PREV NEXT | FRAMES NO FRAMES |