public class EventServiceImpl extends Object implements InternalEventService, MetricsProvider
| Modifier and Type | Field and Description | 
|---|---|
| static String | EVENT_SYNC_FREQUENCY_PROP | 
| Constructor and Description | 
|---|
| EventServiceImpl(NodeEngineImpl nodeEngine) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close(EventRegistration eventRegistration)Closes an EventRegistration. | 
| void | deregisterAllListeners(String serviceName,
                      String topic)Deregisters all listeners belonging to the given service and topic. | 
| boolean | deregisterListener(String serviceName,
                  String topic,
                  Object id)Deregisters a listener with the given registration id. | 
| void | executeEventCallback(Runnable callback)Executes an event callback on a random event thread. | 
| int | getEventQueueCapacity()Returns the queue capacity per event thread. | 
| int | getEventQueueSize()Returns the current total event queue size. | 
| int | getEventThreadCount()Returns the event thread count. | 
| PostJoinRegistrationOperation | getPostJoinOperation() | 
| Collection<EventRegistration> | getRegistrations(String serviceName,
                String topic)Returns all registrations belonging to the given service and topic. | 
| EventRegistration[] | getRegistrationsAsArray(String serviceName,
                       String topic)Returns all registrations belonging to the given service and topic as an array. | 
| EventServiceSegment | getSegment(String service,
          boolean forceCreate) | 
| void | handle(Packet packet)Signals the PacketHandler that there is a packet to be handled. | 
| boolean | handleRegistration(Registration reg) | 
| boolean | hasEventRegistration(String serviceName,
                    String topic)Returns true if a listener is registered with the specified service name and topic. | 
| void | onMemberLeft(MemberImpl member) | 
| void | provideMetrics(MetricsRegistry metricsRegistry) | 
| void | publishEvent(String serviceName,
            Collection<EventRegistration> registrations,
            Object event,
            int orderKey)Publishes an event for multiple event registrations. | 
| void | publishEvent(String serviceName,
            EventRegistration registration,
            Object event,
            int orderKey)Publishes an event for a specific event registration. | 
| void | publishEvent(String serviceName,
            String topic,
            Object event,
            int orderKey)Publishes an event for all event registrations belonging to the specified service name and topic. | 
| void | publishRemoteEvent(String serviceName,
                  Collection<EventRegistration> registrations,
                  Object event,
                  int orderKey)Publishes an event for multiple event registrations, excluding local ones. | 
| EventRegistration | registerListener(String serviceName,
                String topic,
                EventFilter filter,
                Object listener)Registers a listener on all cluster nodes with an event filter. | 
| EventRegistration | registerListener(String serviceName,
                String topic,
                Object listener)Registers a listener on all cluster nodes. | 
| EventRegistration | registerLocalListener(String serviceName,
                     String topic,
                     EventFilter filter,
                     Object listener)Registers a local only listener with an event filter. | 
| EventRegistration | registerLocalListener(String serviceName,
                     String topic,
                     Object listener)Registers a local only listener. | 
| void | shutdown() | 
public static final String EVENT_SYNC_FREQUENCY_PROP
public EventServiceImpl(NodeEngineImpl nodeEngine)
public void provideMetrics(MetricsRegistry metricsRegistry)
provideMetrics in interface MetricsProviderpublic void close(EventRegistration eventRegistration)
InternalEventServiceclose in interface InternalEventServiceeventRegistration - the EventRegistration to close.public int getEventThreadCount()
EventServicegetEventThreadCount in interface EventServiceGroupProperty.EVENT_THREAD_COUNTpublic int getEventQueueCapacity()
EventServicegetEventQueueCapacity in interface EventServiceGroupProperty.EVENT_QUEUE_CAPACITYpublic int getEventQueueSize()
EventServicegetEventQueueSize in interface EventServicepublic EventRegistration registerLocalListener(String serviceName, String topic, Object listener)
EventServiceregisterLocalListener in interface EventServiceserviceName - service nametopic - topic namelistener - listener instancepublic EventRegistration registerLocalListener(String serviceName, String topic, EventFilter filter, Object listener)
EventServiceregisterLocalListener in interface EventServiceserviceName - service nametopic - topic namefilter - event filterlistener - listener instancepublic EventRegistration registerListener(String serviceName, String topic, Object listener)
EventServiceregisterListener in interface EventServiceserviceName - service nametopic - topic namelistener - listener instancepublic EventRegistration registerListener(String serviceName, String topic, EventFilter filter, Object listener)
EventServiceregisterListener in interface EventServiceserviceName - service nametopic - topic namefilter - event filterlistener - listener instancepublic boolean handleRegistration(Registration reg)
public boolean deregisterListener(String serviceName, String topic, Object id)
EventServicederegisterListener in interface EventServiceserviceName - service nametopic - topic nameid - registration idEventRegistration.getId(), 
EventService.registerListener(String, String, Object), 
EventService.registerLocalListener(String, String, Object)public void deregisterAllListeners(String serviceName, String topic)
EventServicederegisterAllListeners in interface EventServiceserviceName - service nametopic - topic namepublic EventRegistration[] getRegistrationsAsArray(String serviceName, String topic)
EventServicegetRegistrationsAsArray in interface EventServiceserviceName - service nametopic - topic namepublic Collection<EventRegistration> getRegistrations(String serviceName, String topic)
EventServicegetRegistrations in interface EventServiceserviceName - service nametopic - topic namepublic boolean hasEventRegistration(String serviceName, String topic)
EventServicehasEventRegistration in interface EventServiceserviceName - service nametopic - topic namepublic void publishEvent(String serviceName, String topic, Object event, int orderKey)
EventServicepublishEvent in interface EventServiceserviceName - service nametopic - topic nameevent - event objectorderKey - order keypublic void publishEvent(String serviceName, EventRegistration registration, Object event, int orderKey)
EventServicepublishEvent in interface EventServiceserviceName - service nameregistration - event registrationevent - event objectorderKey - order keypublic void publishEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
EventServicepublishEvent in interface EventServiceserviceName - service nameregistrations - multiple event registrationsevent - event objectorderKey - order keypublic void publishRemoteEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
EventServicepublishRemoteEvent in interface EventServiceserviceName - service nameregistrations - multiple event registrationsevent - event objectorderKey - order keypublic EventServiceSegment getSegment(String service, boolean forceCreate)
public void executeEventCallback(Runnable callback)
EventService
 If callback is an instance of StripedRunnable,
 then StripedRunnable.getKey() will be used as order key
 to pick event thread.
 
executeEventCallback in interface EventServicecallback - the callback to execute on a random event threadStripedRunnablepublic void handle(Packet packet)
PacketHandlerhandle in interface PacketHandlerpacket - the response packet to handlepublic PostJoinRegistrationOperation getPostJoinOperation()
public void shutdown()
public void onMemberLeft(MemberImpl member)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.