Package com.jtelegram.api.events
Class EventRegistry
- java.lang.Object
-
- com.jtelegram.api.events.EventRegistry
-
public class EventRegistry extends java.lang.Object
EventRegistry This class handles the registration of events and the handler that accompanies it. Each TelegramBot instance SHOULD have its own instance of this EventRegistry
-
-
Constructor Summary
Constructors Constructor Description EventRegistry(TelegramBot bot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends Event>
voiddispatch(E event)
TelegramBot
getBot()
java.util.concurrent.ExecutorService
getThreadPool()
<E extends Event>
voidregisterEvent(java.lang.Class<E> eventType, EventHandler<E> handler)
-
-
-
Constructor Detail
-
EventRegistry
public EventRegistry(TelegramBot bot)
-
-
Method Detail
-
registerEvent
public <E extends Event> void registerEvent(java.lang.Class<E> eventType, EventHandler<E> handler)
-
dispatch
public <E extends Event> void dispatch(E event)
-
getBot
public TelegramBot getBot()
-
getThreadPool
public java.util.concurrent.ExecutorService getThreadPool()
-
-