public class MockEventIpcManager extends Object implements EventForwarder, EventProxy, EventIpcManager, EventIpcBroadcaster
Modifier and Type | Class and Description |
---|---|
static class |
MockEventIpcManager.EmptyEventConfDao
This class implements
EventConfDao but every call returns null. |
static interface |
MockEventIpcManager.SendNowHook |
Constructor and Description |
---|
MockEventIpcManager() |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventListener listener)
Registers an event listener that is interested in all events
|
void |
addEventListener(EventListener listener,
Collection<String> ueis)
Registers an event listener interested in the UEIs in the passed list
|
void |
addEventListener(EventListener listener,
String uei)
Registers an event listener interested in the passed UEI
|
void |
broadcastNow(Event event) |
void |
broadcastNow(Event event,
boolean synchronous)
Called by eventd to send an event to all interested listeners.
|
void |
finishProcessingEvents() |
EventAnticipator |
getEventAnticipator() |
EventdConfig |
getEventdConfig() |
int |
getEventListenerCount() |
int |
getNumSchedulerTheads() |
MockEventIpcManager.SendNowHook |
getSendNowHook() |
boolean |
hasEventListener(String uei)
Checks if there is at least one listener for the given uei.
|
boolean |
isSynchronous() |
void |
removeEventListener(EventListener listener)
Removes a registered event listener
|
void |
removeEventListener(EventListener listener,
Collection<String> ueis)
Removes a registered event listener - the UEI list indicates the list of
events the listener is no more interested in
|
void |
removeEventListener(EventListener listener,
String uei)
Removes a registered event listener - the UEI indicates an event the
listener is no more interested in
|
void |
reset()
Resets the event listeners and resets the event anticipator.
|
void |
send(Event event)
This method is called to send the event out
|
void |
send(Log eventLog)
This method is called to send an event log containing multiple events out
|
void |
sendEventToListeners(Event event) |
void |
sendNow(Event event)
Asynchronously sends an event to eventd.
|
void |
sendNow(Event event,
boolean synchronous) |
void |
sendNow(Log eventLog)
Asynchronously sends a set of events to eventd.
|
void |
sendNowSync(Event event)
Synchronously sends an event to eventd.
|
void |
sendNowSync(Log eventLog)
Synchronously sends a set of events to eventd.
|
void |
setDataSource(DataSource instance) |
void |
setEventAnticipator(EventAnticipator anticipator) |
void |
setEventdConfig(EventdConfig eventdConfig) |
void |
setEventDelay(int millis) |
void |
setEventExpander(EventExpander expander) |
void |
setEventWriter(EventWriter eventWriter) |
void |
setNumSchedulerThreads(int numThreads) |
void |
setSendNowHook(MockEventIpcManager.SendNowHook hook) |
void |
setSynchronous(boolean syncState) |
public void addEventListener(EventListener listener)
EventSubscriptionService
addEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.public void addEventListener(EventListener listener, Collection<String> ueis)
EventSubscriptionService
addEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.ueis
- a Collection
object.public void addEventListener(EventListener listener, String uei)
EventSubscriptionService
addEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.uei
- a String
object.public int getEventListenerCount()
public void broadcastNow(Event event)
public void broadcastNow(Event event, boolean synchronous)
EventIpcBroadcaster
broadcastNow
in interface EventIpcBroadcaster
event
- a Event
object.synchronous
- Whether this call should wait for all EventListener
calls to finish before returning.public void setEventWriter(EventWriter eventWriter)
public EventAnticipator getEventAnticipator()
public void setEventExpander(EventExpander expander)
public void setEventAnticipator(EventAnticipator anticipator)
public void removeEventListener(EventListener listener)
EventSubscriptionService
removeEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.public void removeEventListener(EventListener listener, Collection<String> ueis)
EventSubscriptionService
removeEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.ueis
- a Collection
object.public void removeEventListener(EventListener listener, String uei)
EventSubscriptionService
removeEventListener
in interface EventSubscriptionService
listener
- a EventListener
object.uei
- a String
object.public void setEventDelay(int millis)
public void sendEventToListeners(Event event)
event
- public void setSynchronous(boolean syncState)
public boolean isSynchronous()
public void setSendNowHook(MockEventIpcManager.SendNowHook hook)
public MockEventIpcManager.SendNowHook getSendNowHook()
public void setNumSchedulerThreads(int numThreads)
public int getNumSchedulerTheads()
public void sendNow(Event event)
EventForwarder
sendNow
in interface EventForwarder
event
- a Event
object.public void sendNow(Event event, boolean synchronous)
public void sendNow(Log eventLog)
EventForwarder
sendNow
in interface EventForwarder
eventLog
- a Log
object.public void sendNowSync(Event event)
EventForwarder
sendNowSync
in interface EventForwarder
event
- a Event
object.public void sendNowSync(Log eventLog)
EventForwarder
sendNowSync
in interface EventForwarder
eventLog
- a Log
object.public void finishProcessingEvents()
public EventdConfig getEventdConfig()
public void setEventdConfig(EventdConfig eventdConfig)
public void setDataSource(DataSource instance)
public void reset()
public void send(Event event) throws EventProxyException
EventProxy
send
in interface EventProxy
event
- the event to be sent outEventProxyException
- thrown if the send fails for any reasonpublic void send(Log eventLog) throws EventProxyException
EventProxy
send
in interface EventProxy
eventLog
- the events to be sent outEventProxyException
- thrown if the send fails for any reasonpublic boolean hasEventListener(String uei)
EventSubscriptionService
hasEventListener
in interface EventSubscriptionService
uei
- the uie to check fortrue
iff there is at least one listenerCopyright © 2021. All rights reserved.