public class EventProcessor extends Object implements Runnable, EventListener
Modifier and Type | Class and Description |
---|---|
static class |
EventProcessor.Builder
EventProcessor builder. |
static interface |
EventProcessor.ShutdownHandler
Used to signal that the
EventProcessor reached terminal stage. |
static class |
EventProcessor.State
Event processor state, which is shared with the owner (to be able to control bootstrap and shutdown).
|
Modifier and Type | Method and Description |
---|---|
void |
awaitFirstContact()
Await the initial contact with the SSE endpoint.
|
static EventProcessor.Builder |
builder(WebTarget target,
AtomicReference<EventProcessor.State> state,
ClientExecutor clientExecutor,
EventListener eventListener,
EventProcessor.ShutdownHandler shutdownHandler)
Create new Event processor builder.
|
void |
onEvent(InboundEvent event)
Called by the event source when an inbound event is received.
|
void |
run() |
public static EventProcessor.Builder builder(WebTarget target, AtomicReference<EventProcessor.State> state, ClientExecutor clientExecutor, EventListener eventListener, EventProcessor.ShutdownHandler shutdownHandler)
target
- web target to be used to call remote resource.state
- state shared with the owner of event processor instance.clientExecutor
- executor service used for consuming events and scheduling reconnects.eventListener
- event listener.shutdownHandler
- shutdown callback.EventProcessor.Builder
instance.public void onEvent(InboundEvent event)
EventSource.onEvent(InboundEvent)
method on the owning event source as well as for notifying all registered event listeners
.onEvent
in interface EventListener
event
- incoming inbound event
.public void awaitFirstContact()
Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.