Java runtime for Barrister RPC
Java Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Barrister Java Bindings


Maven or Ivy

To use this in your project, add this dependency to your pom.xml



If you're managing dependencies manually, you need to download 3 JARs:

  • barrister.jar
  • jackson-mapper-asl.jar
  • jackson-core-asl.jar

One way to do this might be:

    curl -o barrister-0.1.16.jar ""
    curl -o jackson-mapper-asl-1.9.7.jar ""
    curl -o jackson-core-asl-1.9.7.jar ""

Then set your CLASSPATH:

export CLASSPATH=barrister-0.1.16.jar:jackson-mapper-asl-1.9.7.jar:jackson-core-asl-1.9.7.jar


idl2java generates Java classes from a Barrister IDL JSON file. To install:

    curl > /usr/local/bin/idl2java
    chmod 755 /usr/local/bin/idl2java
    export PATH=$PATH:/usr/local/bin

Then run against your JSON file:

    idl2java -j my.json -p com.example.mypackage -o src


To use Barrister on your Java project, follow these steps:

  • Write a Barrister IDL file
  • Run the barrister tool to convert the IDL file to .json and (optionally) .html representations
    • See the download page for details on installing the barrister tool. It is separate from the Java bindings
  • Run the idl2java tool bundled with the above Maven dependency to generate Java classes from the IDL json file
    • See the tutorial below for details on running idl2java
  • Write server and/or client implementations based on the generated classes

Exposing service classes

Barrister doesn't tell you how to instantiate your classes at runtime. Consequently you are free to expose your Barrister service classes via Spring, Guice, or as plain Servlets. The example services on the Barrister web site use the provided BarristerServlet, which allows you to expose a single IDL and its related interfaces with no additional code provided that the interface implementation classes contain no-arg constructors. See the Javadoc for a web.xml example of how to use this servlet. The source is also a good example of how to integrate with the Service class. You could adapt this code to wire up your services using the framework of your choice.



Distributed under the MIT license. See LICENSE file for details.

Release / Tag notes

Note to self on how to tag release

# start python conform server so that integration tests can run
cd ~/bitmechanic/barrister/conform; python conform.json &

# Edit `pom.xml`, bump version
# Edit ``, bump example maven dep version
# Edit ``, bump version

# publish to sonatype
mvn -DperformRelease=true clean deploy

(use keepass pw)

# stop python flask server

# publish artifact from staging
# see guide:
login to:
click 'Staging Repositories' in left sidebar
click a repository in middle pane (may popup window with 404, ignore)
bottom panel should show a staged release
click 'Close' button
enter a comment 'barrister 0.1.16'
click 'refresh' on the main pane - status should now be 'closed'
click on the repository again
click 'release' button
enter a comment 'Barrister RPC 0.1.16'

# push tag to github
git add -u
git commit -m "bump v0.1.16"
git tag -a v0.1.16 -m "version 0.1.16"
git push --tags
git push