The source code for the implementation of Dreams, writen in the Scala programming language, is available in our svn repository.

Execution of the Dreams engine

The best way to try the engine is by downloading the zip file with all the required binaries and auxiliary shell scripts.

After unzipping, you can find the following files:

  • lib/engine.jar -- all the needed classes to execute the engine;
  • lib/scala-library.jar -- scala libraries, required by the engine;
  • run.sh -- a shell script to run the distributed engine;
  • manage.sh -- a shell script to interact with a running engine;
  • textreceiver.sh -- a shell script to run a simple receiver;
  • textsender.sh -- a shell script to run a simple sender.

The lib/engine.jar file includes the cwi.reo.engine and cwi.reo.engine.standalone packages. To run the engine just use the run.sh script, giving as arguments the name of the engine, the address (ip) of the machine where the engine is being executed, and an optional port number. If no port number is given, a random port is chosen.

If everything works, you should read a message similar to:

Running: enginename@127.0.0.1:9010

Management of the engine

We advise to use the ECT framework to manage running engines. The Engine plug-in? for the ECT was created specifically for this purpose.

However, there is also a manage.sh script that provides several operations to interact with a running engine, such as deploying, suspending, unsuspending, removing, and connecting primitives. However, this is a more ad hoc approach that gives more control over the engine that required.

Using external components

There are two toy examples developed in Java, whose source code can be easily adapted, that write and read strings into and from a connector. The source code is available in the repository, on the components folder.

To use an external component do the following:

  1. run the engine and create the connector, and do not release the suspension of the primitives;
  2. use the manager.sh to "awake" one of the ends, making it available to the outside (via sockets);
  3. run the textsender.sh or textreceiver.sh to connect to the ends you desire;
  4. the primitives will not be suspended, and you just have to release the suspension of the remaining connector.