Package com.epicbot.api.shared.event
Interface IEpicBotEventBus
-
public interface IEpicBotEventBus
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
post(java.lang.Object event)
Dispatches the provided event to all registered subscribers.void
postAsync(java.lang.Object event)
Dispatches the provided event asynchronously to all registered subscribers.void
register(java.lang.Object subscriber)
Registers the given subscriber.void
unregister(java.lang.Object subscriber)
Unregisters the given subscriber.
-
-
-
Method Detail
-
register
void register(java.lang.Object subscriber)
Registers the given subscriber. All methods in the subscriber and it's parent classes are checked forSubscribe
annotation and then added to map of subscriptions.- Parameters:
subscriber
- the subscriber- Throws:
java.lang.IllegalArgumentException
- in case subscriber method name is wrong (correct format is 'on' + EventName)
-
unregister
void unregister(java.lang.Object subscriber)
Unregisters the given subscriber.- Parameters:
subscriber
- the subscriber
-
post
void post(java.lang.Object event)
Dispatches the provided event to all registered subscribers. Blocking until all subscribers have handled the event.- Parameters:
event
- event to post
-
postAsync
void postAsync(java.lang.Object event)
Dispatches the provided event asynchronously to all registered subscribers.- Parameters:
event
- event to post
-
-