public interface Receiver extends Closeable
Modifier and Type | Method and Description |
---|---|
default void |
close()
Closes the receiver, in particular blocking I/O resources need to be closed here.
|
Receiver |
configure(Serializer eventDeserializer)
Configures the receiver
|
Sender |
createSender()
|
void |
registerHandler(EventHandler<?> handler)
Registers a new
EventHandler |
void |
runWith(ExecutorService executorService)
Since a receiver runs as a thread, the given
ExecutorService should be used to run this thread. |
void |
setDefaultHandler(EventHandler<?> defaultHandler)
Sets the default
EventHandler , used when no other handler is registered for a certain event type |
void registerHandler(EventHandler<?> handler)
EventHandler
handler
- the EventHandler
to registervoid setDefaultHandler(EventHandler<?> defaultHandler)
EventHandler
, used when no other handler is registered for a certain event typedefaultHandler
- the default EventHandler
to useReceiver configure(Serializer eventDeserializer)
eventDeserializer
- the Serializer
for this receiverSender createSender()
Sender
capable of sending Event
s that can be received by this type of
receiver.Sender
void runWith(ExecutorService executorService)
ExecutorService
should be used to run this thread.executorService
- the ExecutorService
to run this receiver withdefault void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
Copyright © 2011–2023 aiticon GmbH. All rights reserved.