Package nl.stokpop.eventscheduler
Class EventBroadcasterAsync
- java.lang.Object
-
- nl.stokpop.eventscheduler.EventBroadcasterAsync
-
- All Implemented Interfaces:
EventBroadcaster
public class EventBroadcasterAsync extends java.lang.Object implements EventBroadcaster
Calls all events in an async manner to avoid the main broadcast thread from being blocked.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intALL_CALLS_TIME_OUT_SECONDS
-
Constructor Summary
Constructors Constructor Description EventBroadcasterAsync(java.util.Collection<Event> events)EventBroadcasterAsync(java.util.Collection<Event> events, EventLogger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbroadcastAbortTest()Blocks for all abort tasks to be finished to try to make sure they get called before jvm shutdown.voidbroadcastAfterTest()The after test calls of all events will run in parallel, but this method will wait for all events to finish before returning.voidbroadcastBeforeTest()The before test calls of all events will run in parallel, but this method will wait for all events to finish before returning.java.util.List<EventCheck>broadcastCheck()voidbroadcastCustomEvent(CustomEvent scheduleEvent)voidbroadcastKeepAlive()voidbroadcastStartTest()voidshutdownAndWaitAllTasksDone(long timeoutSeconds)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.stokpop.eventscheduler.EventBroadcaster
throwAbortOrKillWitchException
-
-
-
-
Field Detail
-
ALL_CALLS_TIME_OUT_SECONDS
protected static final int ALL_CALLS_TIME_OUT_SECONDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EventBroadcasterAsync
public EventBroadcasterAsync(java.util.Collection<Event> events, EventLogger logger)
-
EventBroadcasterAsync
public EventBroadcasterAsync(java.util.Collection<Event> events)
-
-
Method Detail
-
broadcastBeforeTest
public void broadcastBeforeTest()
The before test calls of all events will run in parallel, but this method will wait for all events to finish before returning. This is to make sure all needed activities before the test have finished before the test will start.- Specified by:
broadcastBeforeTestin interfaceEventBroadcaster
-
broadcastStartTest
public void broadcastStartTest()
- Specified by:
broadcastStartTestin interfaceEventBroadcaster
-
broadcastAfterTest
public void broadcastAfterTest()
The after test calls of all events will run in parallel, but this method will wait for all events to finish before returning. This is to make sure all needed activities after the test have finished before the test will finish.- Specified by:
broadcastAfterTestin interfaceEventBroadcaster
-
broadcastKeepAlive
public void broadcastKeepAlive()
- Specified by:
broadcastKeepAlivein interfaceEventBroadcaster
-
broadcastAbortTest
public void broadcastAbortTest()
Blocks for all abort tasks to be finished to try to make sure they get called before jvm shutdown.- Specified by:
broadcastAbortTestin interfaceEventBroadcaster
-
broadcastCustomEvent
public void broadcastCustomEvent(CustomEvent scheduleEvent)
- Specified by:
broadcastCustomEventin interfaceEventBroadcaster
-
broadcastCheck
public java.util.List<EventCheck> broadcastCheck()
- Specified by:
broadcastCheckin interfaceEventBroadcaster
-
shutdownAndWaitAllTasksDone
public void shutdownAndWaitAllTasksDone(long timeoutSeconds)
- Specified by:
shutdownAndWaitAllTasksDonein interfaceEventBroadcaster
-
-