/* send the message */
System.out.println(getName()
+ " sending a synchronus event with message:"
+ message.toString() + "and the topic:"
+ topicToSend);
eventAdmin.sendEvent(new Event(topicToSend, message));
}
}
};
synchDeliver.start();
synchDeliver.join();
Thread asynchDeliver = new Thread() {
public void run() {
for (int i = 0; i < messageTosend; i++) {
/* create the hasht table */
Dictionary message = new Hashtable();
/* create the message */
message.put("Asynchronus message", new Integer(i));
/* Sends a synchronous event to the admin */
System.out.println(getName()
+ " sending an Asynchronus event with message:"
+ message.toString() + "and the topic:"
+ topicToSend);
eventAdmin.postEvent(new Event(topicToSend, message));
}
}
};
asynchDeliver.start();
asynchDeliver.join();