Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Polyglot OSGi Vending Machine
Java Clojure Scala Groovy
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
pgo-vm-api
pgo-vm-clojure-impl
pgo-vm-groovy-impl
pgo-vm-java-impl
pgo-vm-jruby-impl
pgo-vm-scala-impl
pgo-vm-tests
pgo-vm-web
poms
provision
README
VendingMachineSpecification.pdf
pom.xml
swapScala.groovy

README

Polyglot OSGi Vending Machine Implementations

This project is full of example code for a talk I'll be giving at the St. Louis Lambda Lounge in February, and hopefully on the 2010 NFJS Tour.

It implements a contract for a Vending Machine as described in the included PDF in the following languages:

* Java
* Groovy
* Scala
* Clojure
* Ruby (via JRuby, in progress)

The vending machine is accessed via OSGi service exposing only Java types, so as to test the theory that one can build OSGi services in alternative JVM languages without their clients knowing.

The project also includes a Spring Web MVC application that allows you to interact with the various vending machine implementations. You can choose what implementation you want to work with via a drop down box on the page. Run the application as follows:

1) Set everything up as described in the "CAVEATS" below.
2) Run "mvn install" from the root of the project.
3) Run "pax-provision" from the root of the project.
4) Access http://localhost:8080/pgovm/vm.html

CAVEATS:

- This project heavily leverages the PAX tools available at http://wiki.ops4j.org/display/ops4j/Pax. You must have these tools installed to work with this codebase (as well the latest Maven 2).

- The Scala library in the Maven REPO is not a proper OSGi bundle. You must download the Scala OSGi bundle from http://www.scala-lang.org/downloads and overwrite the version in your M2 repository for the Scala functionality to work.

- The JRuby library requires the following directive to be added to its MANIFEST.MF to get going:

DynamicImport-Package: *

This does not completely fix the problems with the JRuby service, but it is definitely required at this point.

- At this point, I haven't figured out how to get Clojure compilation to take place prior to Java compilation, so you'll need to execute:

mvn clojure:compile
mvn install

inside the pgo-vm-clojure-impl bundle to get it properly installed to your M2 repo. At that point, the PAX Exam tests should pass.

Something went wrong with that request. Please try again.