}
@Override
public void register(String eventName) {
String registrationId = UUID.randomUUID().toString();
CometCallback callback = componentContext.getRequestContext().getCallback();
clients.put(registrationId, callback);
synchronized (eventListeners) {
eventListeners.put(eventName, registrationId);
}
Event event = new Event();
event.setId(registrationId);
event.setName(eventName);
event.setData(new Date().toString());
callback.sendMessage(event);
}