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)
orderKey
are ordered, otherwise the order is not preserved.
NOTE : The order may not be preserved in case the event needs to be republished (e.g. when the registration is not on this node and the event has to be retransmitted)
serviceName
- service nametopic
- topic nameevent
- event objectorderKey
- the order key for this event. All events with the same order key are ordered.void publishEvent(String serviceName, EventRegistration registration, Object event, int orderKey)
orderKey
are ordered, otherwise the order is not preserved.
NOTE : The order may not be preserved in case the event needs to be republished (e.g. when the registration is not on this node and the event has to be retransmitted)
serviceName
- service nameregistration
- event registrationevent
- event objectorderKey
- the order key for this event. All events with the same order key are ordered.void publishEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
orderKey
are ordered, otherwise the order is not preserved.
NOTE : The order may not be preserved in case the event needs to be republished (e.g. when the registration is not on this node and the event has to be retransmitted)
serviceName
- service nameregistrations
- multiple event registrationsevent
- event objectorderKey
- the order key for this event. All events with the same order key are ordered.void publishRemoteEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
orderKey
are ordered, otherwise the order is not preserved.
NOTE : The order may not be preserved in case the event needs to be republished (e.g. when the registration is not on this node and the event has to be retransmitted)
serviceName
- service nameregistrations
- multiple event registrationsevent
- event objectorderKey
- the order key for this event. All events with the same order key are ordered.void 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 © 2018 Hazelcast, Inc.. All rights reserved.