Package com.slack.api.app_backend.events
Class EventsDispatcherImpl
java.lang.Object
com.slack.api.app_backend.events.EventsDispatcherImpl
- All Implemented Interfaces:
EventsDispatcher
public class EventsDispatcherImpl extends Object implements EventsDispatcher
-
Constructor Summary
Constructors Constructor Description EventsDispatcherImpl()EventsDispatcherImpl(EventTypeExtractor eventTypeExtractor) -
Method Summary
Modifier and Type Method Description voidderegister(EventHandler<? extends EventsApiPayload<?>> handler)Removes an EventHandler.voiddispatch(String json)Dispatches requests to appropriate event handlers.voidenqueue(String json)Enqueues a JSON payload to the internal queue.longgetMaxTerminationDelayMillis()booleanisEmpty()booleanisRunning()voidregister(EventHandler<? extends EventsApiPayload<?>> handler)Registers a new EventHandler.voidsetMaxTerminationDelayMillis(long maxTerminationDelayMillis)voidstart()Starts the internal thread to handle requests.voidstop()Stops the internal thread to handle requests.
-
Constructor Details
-
EventsDispatcherImpl
public EventsDispatcherImpl() -
EventsDispatcherImpl
-
-
Method Details
-
getMaxTerminationDelayMillis
public long getMaxTerminationDelayMillis() -
setMaxTerminationDelayMillis
public void setMaxTerminationDelayMillis(long maxTerminationDelayMillis) -
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceEventsDispatcher
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEventsDispatcher
-
register
Description copied from interface:EventsDispatcherRegisters a new EventHandler.- Specified by:
registerin interfaceEventsDispatcher
-
deregister
Description copied from interface:EventsDispatcherRemoves an EventHandler.- Specified by:
deregisterin interfaceEventsDispatcher
-
dispatch
Description copied from interface:EventsDispatcherDispatches requests to appropriate event handlers.- Specified by:
dispatchin interfaceEventsDispatcher
-
enqueue
Description copied from interface:EventsDispatcherEnqueues a JSON payload to the internal queue.- Specified by:
enqueuein interfaceEventsDispatcher
-
start
public void start()Description copied from interface:EventsDispatcherStarts the internal thread to handle requests.- Specified by:
startin interfaceEventsDispatcher
-
stop
public void stop()Description copied from interface:EventsDispatcherStops the internal thread to handle requests.- Specified by:
stopin interfaceEventsDispatcher
-