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)
Receiver
configure
in interface Receiver
eventSerializer
- the Serializer
for this receiverpublic void runWith(ExecutorService executorService)
Receiver
ExecutorService
should be used to run this thread.runWith
in interface Receiver
executorService
- the ExecutorService
to run this receiver withpublic Sender createSender()
Receiver
Sender
capable of sending Event
s that can be received by this type of
receiver.createSender
in interface Receiver
Sender
public void registerHandler(EventHandler<?> handler)
Receiver
EventHandler
registerHandler
in interface Receiver
handler
- the EventHandler
to registerpublic void setDefaultHandler(EventHandler<?> defaultHandler)
Receiver
EventHandler
, used when no other handler is registered for a certain event typesetDefaultHandler
in interface Receiver
defaultHandler
- the default EventHandler
to usepublic void close() throws IOException
Receiver
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Receiver
IOException
protected Integer getGroupPort()
protected String getGroupAddress()
protected void setGroupPort(Integer port)
protected void setGroupAddress(String address)
protected boolean isSameAddress(String hostAddress) throws UnknownHostException, SocketException
UnknownHostException
SocketException
Copyright © 2011–2020 aiticon GmbH. All rights reserved.