public interface EventService
Modifier and Type | Method and Description |
---|---|
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.
|
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 the 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 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.
|
int getEventThreadCount()
GroupProperty.EVENT_THREAD_COUNT
int getEventQueueCapacity()
GroupProperty.EVENT_QUEUE_CAPACITY
int getEventQueueSize()
EventRegistration registerLocalListener(String serviceName, String topic, Object listener)
serviceName
- service nametopic
- topic namelistener
- listener instanceEventRegistration registerLocalListener(String serviceName, String topic, EventFilter filter, Object listener)
serviceName
- service nametopic
- topic namefilter
- event filterlistener
- listener instanceEventRegistration registerListener(String serviceName, String topic, Object listener)
serviceName
- service nametopic
- topic namelistener
- listener instanceEventRegistration registerListener(String serviceName, String topic, EventFilter filter, Object listener)
serviceName
- service nametopic
- topic namefilter
- event filterlistener
- listener instanceboolean deregisterListener(String serviceName, String topic, Object id)
serviceName
- service nametopic
- topic nameid
- registration idEventRegistration.getId()
,
registerListener(String, String, Object)
,
registerLocalListener(String, String, Object)
void deregisterAllListeners(String serviceName, String topic)
serviceName
- service nametopic
- topic nameCollection<EventRegistration> getRegistrations(String serviceName, String topic)
serviceName
- service nametopic
- topic nameEventRegistration[] getRegistrationsAsArray(String serviceName, String topic)
serviceName
- service nametopic
- topic nameboolean hasEventRegistration(String serviceName, String topic)
serviceName
- service nametopic
- topic namevoid publishEvent(String serviceName, String topic, Object event, int orderKey)
serviceName
- service nametopic
- topic nameevent
- event objectorderKey
- order keyvoid publishEvent(String serviceName, EventRegistration registration, Object event, int orderKey)
serviceName
- service nameregistration
- event registrationevent
- event objectorderKey
- order keyvoid publishEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
serviceName
- service nameregistrations
- multiple event registrationsevent
- event objectorderKey
- order keyvoid publishRemoteEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
serviceName
- service nameregistrations
- multiple event registrationsevent
- event objectorderKey
- order keyvoid executeEventCallback(Runnable callback)
If callback
is an instance of StripedRunnable
,
then StripedRunnable.getKey()
will be used as order key
to pick event thread.
callback
- the callback to execute on a random event threadStripedRunnable
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.