JOMS overview

JOMS ( Java Opportunistic Message Service ) is a JMS Provider that I have developed during the first year of my Ph.D. JOMS acts as a middleware between the already existing JMS applications and D-MANETs. The main characteristic of JOMS is that it provides mobile wireless applications, act as JMS clients, with JMS services over this very challenge type of MANET. According to JMS specification, the use of the JNDI service is essential. For this reason, JOMS supports a server-less version of JNDI. JOMS along with its server-less version of JNDI have passed several extremely challenging tests with great success. So I can say that JOMS will open the door to other dimensions of dealing with existing standard middlewares.


Web Template
Keywords

Java Message Service, JMS implementation, Message-oriented Middleware, D-MANETs, JNDI.


Quick Links

Pre-Requirements

Before you start using JOMS, the DoDWAN platform is required to be installed and configured on hosts. For installing DoDWAN, please refer here.

Top...

JOMS v2 new features

Top...

Download
Web Template
Let me guess:

You think that you read a lot about amazing theoretical algorithms?
You want to develop something real in D-MANETs?
You want a real application that works well in these very challenging environments?

OK? Great! you are in the right place. The source code of JOMS with many examples are now distributed under the terms of the GNU General Public License. The source code consists of about 10000 lines of code. So good luck, and here is:
JOMS v2: binary files.
JOMS v1: source files, binary files.

Top...

Getting started

Once you have downloaded and installed JOMS, you can start testing it using one of the multiples examples provided in the source code. Please notice that these examples are located under jms/basic directory. If you are not familiar with JMS, then the JMS tutorial from oracle is a useful guide.

If you feel like you do not have time to read every thing in that tutorial and JMS sounded so much familiar to you, then I suggest you something else. Sit back, relax and give the following example some thought.

Top...

JOMS tutorial
Step 1: Import the required Packages
import casa.joms.*;
import casa.joms.admin.*;
import casa.joms.jndi.*;
Step 2: Launch the JOMS and the JNDI on the local host
// JOMS
AdminTools atools=new AdminTools();
// JNDI service
Context cntx=ContextSingleton.getInstance();
Step 3: Look up a JMS Connection Factory and a JMS Topic in JNDI namespace
// Connection Factory
TopicConnectionFactory tcf =cntxt.lookup(topicConnectionFactoryId);
// If no Connection Factory has been created yet, then an instance of it
// could be retrieved using the Admin tools
TopicConnectionFactory tcf = atools.createTopicConnectionFactory();
// Topic
Topic topic = cntxt.lookup(topicId);
// If no topic has been created yet, a new one could be created using the Admin tools
Topic topic = atools.addDestination(...);
Step 4: Create a Connection using the Connection Factory
TopicConnection tc=tcf.createTopicConnection();
Step 5: Create a Session using the Connection
TopicSession ts= tc.createTopicSession(....);
Step 6: Create a Message Producer using the Session and the Topic
// Topic Publisher
TopicPublisher tp= ts.createPublisher(topic);
Step 7: Create a Message using the Session and the Topic
TextMessage msg= ts.createTextMessage(payload);
Step 8: send the Message
tp.publish(msg);

Top...

The Console

You want to test JOMS in real conditions but you do not want to burn yourself out writing too many applications. Okay, here is the solution. JOMS offers you with an interactive tools, called Console. This console provides you with the most commonly JMS commands, i.e., destination-object management, Pub/Sub commands and Send/Receiver commands. Furthermore, this console allows you to discover all of the destination objects exist in JNDI namespace. The console’s source code is available at jms/admin directory.


Scenario

You can check the scenario in the following figure: there are four devices, named here A, B, C and D. All of these hosts are configured with JOMS. And now, the following steps describe how to run the Console in the this scenario:


Web Template

Step 1: Launch the console on A, B, C and D
java -cp joms-1.1-jar-with-dependencies.jar casa.dodwan.jms.admin.AdminToolsTCPConsole
Step 2: Access to the console on A, B, C and D
// The port number could be changed using the configuration file
telnet localhost 8600

Congratulation! you can now use it. The following examples demonstrate how to use some of the console commands:

To see the full list of console's commands on any device, type:
h
To create a topic named “ChatRoom1” on the device A, type:
add -t topic -n ChatRoom1
To find all of the destination objects stored in the local namespace on the device B, type:
?j
To publish a message named “firstMSG” to "ChatRoom1" with payload “HelloWorld” and message selector “language=English” from the host C to the topic “ChatRoom1”, type:
pub -t ChatRoom1 -id firstMSG -p HelloWorld -ssl language=English
To subscribe to the topic "ChatRoom1" in the host D in order to receive the messages with properties “language=English” or “language=French”, type:
sub -t ChatRoom1 -ssl language=English|French

Top...

API specification

Building an effective JOMS application requires you to read JOMS APIs. The documentations and API specification for JOMS are included in the source code, and can also be accessed online here.

Top...