.println(getName()
+ " sending a synchronus event with message:"
+ message.toString()
+ "and the topic:" + topicToSend);
eventAdmin
.sendEvent(new Event(topicToSend, message));
/* Puts the thread to sleep for 10 seconds */
i++;
Thread.sleep(10000);
} catch (InterruptedException e) {
//ignored, treated by while loop
}
}
}
};
synchDeliver.start();
asynchDeliver = new Thread() {
public void run() {
int i = 0;
while (!stopped && !Thread.interrupted()) {
try {
/* a Hash table to store message in */
Dictionary message = new Hashtable();
/* put some properties into the messages */
message.put("Asynchronus message", new Integer(i));
/* send the message */
System.out
.println(getName()
+ " sending a asynchronus event with message:"
+ message.toString()
+ "and the topic:" + topicToSend);
eventAdmin
.sendEvent(new Event(topicToSend, message));
/* Puts the thread to sleep for 10 seconds */
i++;
Thread.sleep(10000);
} catch (InterruptedException e) {
//ignored, treated by while loop