public class EventServiceImpl extends Object implements EventService
Modifier and Type | Class and Description |
---|---|
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 |
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 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.
|
public int getEventThreadCount()
EventService
getEventThreadCount
in interface EventService
GroupProperties.PROP_EVENT_THREAD_COUNT
public int getEventQueueCapacity()
EventService
getEventQueueCapacity
in interface EventService
GroupProperties.PROP_EVENT_QUEUE_CAPACITY
public int getEventQueueSize()
EventService
getEventQueueSize
in interface EventService
public EventRegistration registerLocalListener(String serviceName, String topic, Object listener)
EventService
registerLocalListener
in interface EventService
serviceName
- service nametopic
- topic namelistener
- listener instancepublic EventRegistration registerLocalListener(String serviceName, String topic, EventFilter filter, Object listener)
EventService
registerLocalListener
in interface EventService
serviceName
- service nametopic
- topic namefilter
- event filterlistener
- listener instancepublic EventRegistration registerListener(String serviceName, String topic, Object listener)
EventService
registerListener
in interface EventService
serviceName
- service nametopic
- topic namelistener
- listener instancepublic EventRegistration registerListener(String serviceName, String topic, EventFilter filter, Object listener)
EventService
registerListener
in interface EventService
serviceName
- service nametopic
- topic namefilter
- event filterlistener
- listener instancepublic boolean deregisterListener(String serviceName, String topic, Object id)
EventService
deregisterListener
in interface EventService
serviceName
- service nametopic
- topic nameid
- registration idEventRegistration.getId()
,
EventService.registerListener(String, String, Object)
,
EventService.registerLocalListener(String, String, Object)
public void deregisterAllListeners(String serviceName, String topic)
EventService
deregisterAllListeners
in interface EventService
serviceName
- service nametopic
- topic namepublic EventRegistration[] getRegistrationsAsArray(String serviceName, String topic)
EventService
getRegistrationsAsArray
in interface EventService
serviceName
- service nametopic
- topic namepublic Collection<EventRegistration> getRegistrations(String serviceName, String topic)
EventService
getRegistrations
in interface EventService
serviceName
- service nametopic
- topic namepublic boolean hasEventRegistration(String serviceName, String topic)
EventService
hasEventRegistration
in interface EventService
serviceName
- service nametopic
- topic namepublic void publishEvent(String serviceName, String topic, Object event, int orderKey)
EventService
publishEvent
in interface EventService
serviceName
- service nametopic
- topic nameevent
- event objectorderKey
- order keypublic void publishEvent(String serviceName, EventRegistration registration, Object event, int orderKey)
EventService
publishEvent
in interface EventService
serviceName
- service nameregistration
- event registrationevent
- event objectorderKey
- order keypublic void publishEvent(String serviceName, Collection<EventRegistration> registrations, Object event, int orderKey)
EventService
publishEvent
in interface EventService
serviceName
- service nameregistrations
- multiple event registrationsevent
- event objectorderKey
- order keypublic 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 EventService
callback
- callback to executeStripedRunnable
public EventServiceImpl.PostJoinRegistrationOperation getPostJoinOperation()
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.