// autoCreate EventQueue
EventQueue eq = EventQueues.lookup("ApplicationEventQueue", EventQueues.APPLICATION, true);
// listen
eq.subscribe(new SerializableEventListener() {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
public void onEvent(Event event) throws Exception {
System.out.println("ApplicationEventQueue onEvent");
if (event.getName().equals("APPLICATION_NOTIFICATION")) {
Map<String, Object> map = (Map<String, Object>) event.getData();
showNotification(map);
}
}
});
} else {
// Get the EventQueue
EventQueue eq = EventQueues.lookup("ApplicationEventQueue", EventQueues.APPLICATION, false);
// NEW listen
eq.subscribe(new SerializableEventListener() {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
public void onEvent(Event event) throws Exception {