Session-based Distributed Programming in Java

Raymond Hu (homepage), Nobuko Yoshida (homepage), Kohei Honda (homepage)


This paper demonstrates the impact of integrating session types and object-oriented programming, through their implementation in Java. Session types provide high-level abstraction for structuring a series of interactions in a concise syntax, and ensure type-safe communications between distributed peers. We present the first full implementation of a language and runtime for session-based distributed programming featuring asynchronous message passing, delegation, and session subtyping and interleaving, combined with class downloading and failure handling. The compilation-runtime framework of our language effectively maps session abstraction onto underlying transports and guarantees communication safety through static and dynamic session type checking. We have implemented two alternative mechanisms for performing distributed session delegation and prove their correctness. Benchmark results show session abstraction can be realised with low runtime overhead.

Note: the latest version of SJ is located here. The materials on this page are no longer actively maintained.


A SessionJ compiler and runtime:
Comments, questions and bug reports are very welcome.

This project is implemented using the Polyglot compiler framework.

Benchmark results from Section 5 of the above paper.

To compile an SJ program, from the sj directory do

   bin/sjc tests/src/.../ -d tests/classes/...

and to run a compiled program, do

   bin/sj -cp tests/classes/... MyProgram

Note: the SJ compiler currently accepts only Java 1.4, due to the version of Polyglot used.

Some additional material:

Updated 2008-08-26.