Distributed paradigms
Distributed paradigms

This free course is available to start right now. Review the full course description and key learning outcomes and create an account and enrol if you want a free statement of participation.

Free course

Distributed paradigms

4.3 A commercial implementation

In order to conclude this section I shall describe a commercial implementation of an object bus. It has been developed by a company known as SoftWired Ltd and is known as iBus. It is based on TCP/IP rather than UDP. The facilities offered by the iBus API provide developers with the facilities to construct objects which can subscribe to channels and to transmit any Java object to a channel. The code for a transmitter is shown below; the import statements are not shown. In the code for the transmitter and the receiver an object which is sent along the bus is known as a object.

This example is based on one used in a Sun Java training course SL30 1 Distributed Programming with Java. It is simple code: all that it does is to send the string message out on the bus. The bus is identified by a special type of URL which starts with the protocol identifier “ibus”. The variable st is a protocol stack; the constructor uses the string “Reliable” to indicate that it wants the data sent using a reliable protocol where data is guaranteed to arrive at its destination – not, for example, UDP.

The code for a very simple listener object is shown below; it just receives an object, displays it and exits.

The code is relatively straightforward. The class acts as the driver class. The method inside this class sets up a receiver object which is defined by the class and attaches it to the bus. The class implements the interface which has three methods whose code has to be provided. The only processing code for a method in this example is needed in which is executed when an object is sent down the bus.

The interface Receiver acts very much like a listener interface found in the Java AWT.

M879_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to university level study, find out more about the types of qualifications we offer, including our entry level Access courses and Certificates.

Not ready for University study then browse over 900 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus