Constructor and Description |
---|
TribesReceiver() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Serializable msg,
org.apache.catalina.tribes.Member sender) |
TribesReceiver |
configure(Serializer eventSerializer)
Configures the receiver
|
Sender |
createSender()
|
protected String |
getGroupAddress() |
protected Integer |
getGroupPort() |
protected org.apache.catalina.tribes.ChannelInterceptor |
getMessageDispatchInterceptor() |
protected InetAddress |
getNodeAddress() |
protected boolean |
isSameAddress(String hostAddress) |
void |
messageReceived(Serializable msg,
org.apache.catalina.tribes.Member sender) |
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 TribesReceiver 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
protected org.apache.catalina.tribes.ChannelInterceptor getMessageDispatchInterceptor() throws ReflectiveOperationException
ReflectiveOperationException
public void messageReceived(Serializable msg, org.apache.catalina.tribes.Member sender)
messageReceived
in interface org.apache.catalina.tribes.ChannelListener
public boolean accept(Serializable msg, org.apache.catalina.tribes.Member sender)
accept
in interface org.apache.catalina.tribes.ChannelListener
protected InetAddress getNodeAddress() throws UnknownHostException
UnknownHostException
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 useprotected 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–2019 aiticon GmbH. All rights reserved.