Class EventProcessor.Builder
java.lang.Object
org.glassfish.jersey.media.sse.internal.EventProcessor.Builder
- Enclosing class:
- EventProcessor
EventProcessor builder.-
Method Summary
Modifier and TypeMethodDescriptionboundListeners(Map<String, List<EventListener>> boundListeners) Unbounded listeners will get notified about incoming events with particular name.build()Build theEventProcessor.Disables keepalive.reconnectDelay(long reconnectDelay, TimeUnit unit) Set initial reconnect delay.throwableConsumers(List<Consumer<Throwable>> throwableConsumers) Set the consumers ofThrowableoccurring during connection.unboundListeners(List<EventListener> unboundListeners) Unbounded listeners will get notified about any incoming event.
-
Method Details
-
reconnectDelay
Set initial reconnect delay. Reconnect delay can be controlled by the server side, adding specific properties to incoming events.- Parameters:
reconnectDelay- reconnect delay value.unit- reconnect delay timeunit.- Returns:
- updated builder instance.
-
unboundListeners
Unbounded listeners will get notified about any incoming event.- Parameters:
unboundListeners- list of listeners.- Returns:
- updated builder instance.
-
boundListeners
Unbounded listeners will get notified about incoming events with particular name.- Parameters:
boundListeners- map of bound listeners, key is a name to which listeners are bound to, value is a list of listeners.- Returns:
- updated builder instance.
- See Also:
-
disableKeepAlive
Disables keepalive.- Returns:
- updated builder instance.
-
throwableConsumers
Set the consumers ofThrowableoccurring during connection.- Parameters:
throwableConsumers- a list of consumers of throwable.- Returns:
- updated builder instance.
-
build
Build theEventProcessor.- Returns:
- built Event processor instance.
-