Introduction

PrologBeans is a package for integrating Java and Prolog applications. The main idea is to separate the two processes so that they can be run on more than one machine. This differs from Jasper where both the SICStus and the JVM share the same process. For large applications it is useful to run SICStus and the JVM in separate processes or even on separate machines to avoid memory conflicts and other undesirable interactions between the Java and SICStus run-time systems.

The current version is designed to be used when Java applications need to send queries to a Prolog server (and less intended for showing a GUI from a Prolog program). One typical application is to connect Java based web applications to a Prolog server (see examples later).

images/prologbeansarch.png PrologBeans setup where the Prolog application serves several users accessing both via a web application server and a Java GUI.

The PrologBeans package is split into the file prologbeans.jar, to be used in the Java application, and the library(prologbeans) module, to be used in the Prolog part of the application, i.e. the Prolog server.

All PrologBeans examples can be found in the library('prologbeans/examples') directory, which will be referred to as the pbexamples file search path in this chapter, defined as if by a clause:

     user:file_search_path(pbexamples, library('prologbeans/examples')).