com.hazelcast.spi.impl
Class EventServiceImpl

java.lang.Object
  extended by com.hazelcast.spi.impl.EventServiceImpl
All Implemented Interfaces:
EventService

public class EventServiceImpl
extends Object
implements EventService


Nested Class Summary
static class EventServiceImpl.DeregistrationOperation
           
static class EventServiceImpl.EmptyFilter
           
static class EventServiceImpl.EventPacket
           
static class EventServiceImpl.PostJoinRegistrationOperation
           
static class EventServiceImpl.Registration
           
static class EventServiceImpl.RegistrationOperation
           
static class EventServiceImpl.SendEventOperation
           
 
Method Summary
 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 given registration id.
 void executeEventCallback(Runnable callback)
          Executes an event callback on a random event thread.
 int getEventQueueCapacity()
          Returns queue capacity per event thread.
 int getEventQueueSize()
          Returns current total event queue size.
 int getEventThreadCount()
          Returns event thread count.
 EventServiceImpl.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.
 boolean hasEventRegistration(String serviceName, String topic)
          Returns true if a listener is registered with specified service name and topic.
 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 specified service name and topic.
 EventRegistration registerListener(String serviceName, String topic, EventFilter filter, Object listener)
          Registers a listener on all cluster nodes.
 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.
 EventRegistration registerLocalListener(String serviceName, String topic, Object listener)
          Registers a local only listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEventThreadCount

public int getEventThreadCount()
Description copied from interface: EventService
Returns event thread count.

Specified by:
getEventThreadCount in interface EventService
Returns:
event thread count
See Also:
GroupProperties.PROP_EVENT_THREAD_COUNT

getEventQueueCapacity

public int getEventQueueCapacity()
Description copied from interface: EventService
Returns queue capacity per event thread.

Specified by:
getEventQueueCapacity in interface EventService
Returns:
queue capacity per event thread
See Also:
GroupProperties.PROP_EVENT_QUEUE_CAPACITY

getEventQueueSize

public int getEventQueueSize()
Description copied from interface: EventService
Returns current total event queue size.

Specified by:
getEventQueueSize in interface EventService
Returns:
total event queue size

registerLocalListener

public EventRegistration registerLocalListener(String serviceName,
                                               String topic,
                                               Object listener)
Description copied from interface: EventService
Registers a local only listener.

Specified by:
registerLocalListener in interface EventService
Parameters:
serviceName - service name
topic - topic name
listener - listener instance
Returns:
event registration

registerLocalListener

public EventRegistration registerLocalListener(String serviceName,
                                               String topic,
                                               EventFilter filter,
                                               Object listener)
Description copied from interface: EventService
Registers a local only listener.

Specified by:
registerLocalListener in interface EventService
Parameters:
serviceName - service name
topic - topic name
filter - event filter
listener - listener instance
Returns:
event registration

registerListener

public EventRegistration registerListener(String serviceName,
                                          String topic,
                                          Object listener)
Description copied from interface: EventService
Registers a listener on all cluster nodes.

Specified by:
registerListener in interface EventService
Parameters:
serviceName - service name
topic - topic name
listener - listener instance
Returns:
event registration

registerListener

public EventRegistration registerListener(String serviceName,
                                          String topic,
                                          EventFilter filter,
                                          Object listener)
Description copied from interface: EventService
Registers a listener on all cluster nodes.

Specified by:
registerListener in interface EventService
Parameters:
serviceName - service name
topic - topic name
filter - event filter
listener - listener instance
Returns:
event registration

deregisterListener

public boolean deregisterListener(String serviceName,
                                  String topic,
                                  Object id)
Description copied from interface: EventService
Deregisters a listener with given registration id.

Specified by:
deregisterListener in interface EventService
Parameters:
serviceName - service name
topic - topic name
id - registration id
Returns:
true if listener is deregistered successfully, false otherwise
See Also:
EventRegistration.getId(), EventService.registerListener(String, String, Object), EventService.registerLocalListener(String, String, Object)

deregisterAllListeners

public void deregisterAllListeners(String serviceName,
                                   String topic)
Description copied from interface: EventService
Deregisters all listeners belonging to the given service and topic.

Specified by:
deregisterAllListeners in interface EventService
Parameters:
serviceName - service name
topic - topic name

getRegistrationsAsArray

public EventRegistration[] getRegistrationsAsArray(String serviceName,
                                                   String topic)
Description copied from interface: EventService
Returns all registrations belonging to the given service and topic as an array.

Specified by:
getRegistrationsAsArray in interface EventService
Parameters:
serviceName - service name
topic - topic name
Returns:
registrations array

getRegistrations

public Collection<EventRegistration> getRegistrations(String serviceName,
                                                      String topic)
Description copied from interface: EventService
Returns all registrations belonging to the given service and topic.

Specified by:
getRegistrations in interface EventService
Parameters:
serviceName - service name
topic - topic name
Returns:
registrations

hasEventRegistration

public boolean hasEventRegistration(String serviceName,
                                    String topic)
Description copied from interface: EventService
Returns true if a listener is registered with specified service name and topic.

Specified by:
hasEventRegistration in interface EventService
Parameters:
serviceName - service name
topic - topic name
Returns:
true if a listener is registered with specified service name and topic, false otherwise.

publishEvent

public void publishEvent(String serviceName,
                         String topic,
                         Object event,
                         int orderKey)
Description copied from interface: EventService
Publishes an event for all event registrations belonging to specified service name and topic.

Specified by:
publishEvent in interface EventService
Parameters:
serviceName - service name
topic - topic name
event - event object
orderKey - order key

publishEvent

public void publishEvent(String serviceName,
                         EventRegistration registration,
                         Object event,
                         int orderKey)
Description copied from interface: EventService
Publishes an event for a specific event registration.

Specified by:
publishEvent in interface EventService
Parameters:
serviceName - service name
registration - event registration
event - event object
orderKey - order key

publishEvent

public void publishEvent(String serviceName,
                         Collection<EventRegistration> registrations,
                         Object event,
                         int orderKey)
Description copied from interface: EventService
Publishes an event for multiple event registrations.

Specified by:
publishEvent in interface EventService
Parameters:
serviceName - service name
registrations - multiple event registrations
event - event object
orderKey - order key

executeEventCallback

public void executeEventCallback(Runnable callback)
Description copied from interface: EventService
Executes an event callback on a random event thread.

If callback is an instance of StripedRunnable, then StripedRunnable.getKey() will be used as order key to pick event thread.

Specified by:
executeEventCallback in interface EventService
Parameters:
callback - callback to execute
See Also:
StripedRunnable

getPostJoinOperation

public EventServiceImpl.PostJoinRegistrationOperation getPostJoinOperation()


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.