| Constructor and Description |
|---|
MulticastReceiver() |
MulticastReceiver(String address,
Integer port) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the receiver, in particular blocking I/O resources need to be closed here.
|
MulticastReceiver |
configure(Serializer eventSerializer)
Configures the receiver
|
Sender |
createSender()
|
protected String |
getGroupAddress() |
protected Integer |
getGroupPort() |
protected boolean |
isSameAddress(String hostAddress) |
void |
registerHandler(EventHandler<?> handler)
Registers a new
EventHandler |
void |
run() |
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 |
protected void |
setGroupAddress(String address) |
protected void |
setGroupPort(Integer port) |
public MulticastReceiver configure(Serializer eventSerializer)
Receiverconfigure in interface ReceivereventSerializer - the Serializer for this receiverpublic void runWith(ExecutorService executorService)
ReceiverExecutorService should be used to run this thread.runWith in interface ReceiverexecutorService - the ExecutorService to run this receiver withpublic Sender createSender()
ReceiverSender capable of sending Events that can be received by this type of
receiver.createSender in interface ReceiverSenderpublic void registerHandler(EventHandler<?> handler)
ReceiverEventHandlerregisterHandler in interface Receiverhandler - the EventHandler to registerpublic void setDefaultHandler(EventHandler<?> defaultHandler)
ReceiverEventHandler, used when no other handler is registered for a certain event typesetDefaultHandler in interface ReceiverdefaultHandler - the default EventHandler to usepublic void close()
throws IOException
Receiverclose in interface Closeableclose in interface AutoCloseableclose in interface ReceiverIOExceptionprotected Integer getGroupPort()
protected String getGroupAddress()
protected void setGroupPort(Integer port)
protected void setGroupAddress(String address)
protected boolean isSameAddress(String hostAddress) throws UnknownHostException, SocketException
UnknownHostExceptionSocketExceptionCopyright © 2011–2018 aiticon GmbH. All rights reserved.