Comm

Comm is a server-less and asynchronous event handling library that allows inter-communication between Java and JavaScript with an uniform API.

Comm Use Cases

  • Secure messaging between the JavaScript code and Java in general.

  • Triggering UI changes from Java.

  • Non-blocking and future-proof replacement for sync Browser functions.

Using Comm in an OSGi Application

To use Comm in an OSGi application, you need to run the following bundles:

  • com.equo.comm.api

  • com.equo.comm.ee.provider

The JavaScript API equo-comm.js should be automatically injected in the browser. It is also available as an npm package named @equo/comm. To see how to use it this way check Using the Java and JavaScript APIs.

You can use the ICommService API in your application by injecting it as an OSGi service or find a reference programatically using ICommService.findServiceReference().

Using Comm in a plain Java Application

Since 1.7.0 you can use Comm in plain Java applications, to obtain a reference to the API use ICommService.findServiceReference().

API

Its usage and some simple use-cases are described in Java and JavaScript Communication.

Dynamic send service

The bundle com.equo.comm.ee.provider also provides a dynamic implementation of the ICommSendService. When the browsers become ready to receive messages the service gets registered and otherwise unregistered accordingly. To use it you should inject it using OSGi mechanisms, taking into account the possibility of it being unregistered at any moment.

When using ICommService to send events, there’s a stub send implementation that saves the messages until an ICommService becomes available and when it does, it redirects those messages to that service.