Chapter 12. External Domains and Connectors

Since tools are mostly neither developed for the OpenEngSB nor written in any way that they can be directly deployed in the OpenEngSB environment a way is required to connect via different programming languages than Java and from multible protocols. This section covers the examples in different languages and protocols, how such a thing can be achived.

12.1. Proxying

The proxy mechanism allows for any method call to be intercepted.

12.1.1. Proxying internal Connector calls

The proxy mechanism allows to create proxies for any domain. To create a proxy you have to provide a port id, destination and service id to call on the remote service. A Port encapsulates the protocol that is used to call another service. There are an OutgoingPort and IncomingPort interface for respective purposes. The port id is used to load the Port via OSGI. To include a Port in OPENENGSB it just has to be exported via OSGI. The destination is a string that has to be correctly interpreted by the port to call the remote server. The service id is added as metadata do identify the service that shold get called on the remote server. It may not be needed for certain implementations.

The proxy calls the CallRouter which redirects the methodcall to the respective Port. Security is implemented in this layer.

12.2. Using JMS proxying

The current JMS Connector allows for internal method calls being redirected via JMS as well as internal services being called.

12.2.1. Proxying internal Connector calls

Whenever now a method is sent through the JMS Port the call is marshalled and sent via JMS to a queue named "receive"". The marshalling is done via JSON. The mapping has the parameters methodName, args, classes, metadata and potentially answer and callId. methodName gives the name of the method to call. Args are the serialised parameters of the method. classes are the types of the arguments. This way it is easy to unmarshall the args into the appropriate classes. metadata is a simple Map which stores key value pairs. answer can simply be yes or no and denotes if the methodcall wants an answer to the call. callId gives the return queue the caller will listen to for an answer.

An answer can have the type, arg, className and metaData properties. type can be Object, Exception or Void. arg is the serialised form of the return argument. className is the runtime class of the arg for deserialisation. metadata is a simple key value store.

12.2.2. Calling internal Services

To call an internal Service send a methodcall as described before to the "receive" queue on the on the server you want to call. The service works exactly as defined before.

By default a JMS Broker is started on port 6549.

12.2.3. Examples

12.2.3.1. Connect With Python

To test the OPENENGSB JMS implementation with Python please follow the instructions

The example can be downloaded here

12.2.3.2. Connect With CSharp

The CSharp connector is written on basis of the Apache ActiveMQ NMS connector and with help of the Spring NmsTemplate. The code is checked into the repository and could be found in nonjava/csharp. There an EngSB.sln file. This project file has been developed with SharpDevelop 3, but is also tested with VisualStudio 2008 CSharp Express Edition with the .Net Framework 3.5.

The example can be downloaded here

12.2.3.3. Connect With Perl

As shown in this example you can connect to the OpenEngSB in a similar way as with Python or CSharp.

The example can be downloaded here