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)
EventHandlerhandler - 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 Events that can be received by this type of
receiver.Sendervoid 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 AutoCloseableclose in interface CloseableIOExceptionCopyright © 2011–2020 aiticon GmbH. All rights reserved.