Exemplo n.º 1
0
 private void sendClientEvent(ClientEndpoint endpoint) {
   if (endpoint.isFirstConnection()) {
     final EventService eventService = nodeEngine.getEventService();
     final Collection<EventRegistration> regs =
         eventService.getRegistrations(SERVICE_NAME, SERVICE_NAME);
     eventService.publishEvent(SERVICE_NAME, regs, endpoint, endpoint.getUuid().hashCode());
   }
 }
Exemplo n.º 2
0
 public void publishEvent(ItemEventType eventType, Data data) {
   EventService eventService = getNodeEngine().getEventService();
   Collection<EventRegistration> registrations =
       eventService.getRegistrations(getServiceName(), name);
   for (EventRegistration registration : registrations) {
     QueueEventFilter filter = (QueueEventFilter) registration.getFilter();
     QueueEvent event =
         new QueueEvent(
             name,
             filter.isIncludeValue() ? data : null,
             eventType,
             getNodeEngine().getThisAddress());
     eventService.publishEvent(getServiceName(), registration, event, name.hashCode());
   }
 }
Exemplo n.º 3
0
 public boolean hasListener() {
   EventService eventService = getNodeEngine().getEventService();
   Collection<EventRegistration> registrations =
       eventService.getRegistrations(getServiceName(), name);
   return registrations.size() > 0;
 }