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
All Methods Instance Methods Concrete Methods 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 Detail
-
EventsDispatcherImpl
public EventsDispatcherImpl()
-
EventsDispatcherImpl
public EventsDispatcherImpl(EventTypeExtractor eventTypeExtractor)
-
-
Method Detail
-
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
public void register(EventHandler<? extends EventsApiPayload<?>> handler)
Description copied from interface:EventsDispatcherRegisters a new EventHandler.- Specified by:
registerin interfaceEventsDispatcher
-
deregister
public void deregister(EventHandler<? extends EventsApiPayload<?>> handler)
Description copied from interface:EventsDispatcherRemoves an EventHandler.- Specified by:
deregisterin interfaceEventsDispatcher
-
dispatch
public void dispatch(String json)
Description copied from interface:EventsDispatcherDispatches requests to appropriate event handlers.- Specified by:
dispatchin interfaceEventsDispatcher
-
enqueue
public void enqueue(String json)
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
-
-