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 void
deregister(EventHandler<? extends EventsApiPayload<?>> handler)
Removes an EventHandler.void
dispatch(String json)
Dispatches requests to appropriate event handlers.void
enqueue(String json)
Enqueues a JSON payload to the internal queue.long
getMaxTerminationDelayMillis()
boolean
isEmpty()
boolean
isRunning()
void
register(EventHandler<? extends EventsApiPayload<?>> handler)
Registers a new EventHandler.void
setMaxTerminationDelayMillis(long maxTerminationDelayMillis)
void
start()
Starts the internal thread to handle requests.void
stop()
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:
isRunning
in interfaceEventsDispatcher
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceEventsDispatcher
-
register
public void register(EventHandler<? extends EventsApiPayload<?>> handler)
Description copied from interface:EventsDispatcher
Registers a new EventHandler.- Specified by:
register
in interfaceEventsDispatcher
-
deregister
public void deregister(EventHandler<? extends EventsApiPayload<?>> handler)
Description copied from interface:EventsDispatcher
Removes an EventHandler.- Specified by:
deregister
in interfaceEventsDispatcher
-
dispatch
public void dispatch(String json)
Description copied from interface:EventsDispatcher
Dispatches requests to appropriate event handlers.- Specified by:
dispatch
in interfaceEventsDispatcher
-
enqueue
public void enqueue(String json)
Description copied from interface:EventsDispatcher
Enqueues a JSON payload to the internal queue.- Specified by:
enqueue
in interfaceEventsDispatcher
-
start
public void start()
Description copied from interface:EventsDispatcher
Starts the internal thread to handle requests.- Specified by:
start
in interfaceEventsDispatcher
-
stop
public void stop()
Description copied from interface:EventsDispatcher
Stops the internal thread to handle requests.- Specified by:
stop
in interfaceEventsDispatcher
-
-