public interface MessageListener
Message
or a state transfer
events arrives to a node.
MessageListener is often used by JGroups building blocks installed on top of a channel i.e RpcDispatcher and MessageDispatcher.
RpcDispatcher
,
MessageDispatcher
Modifier and Type | Method and Description |
---|---|
void |
getState(java.io.OutputStream output)
Allows an application to write a state through a provided OutputStream.
|
void |
receive(Message msg)
Called when a message is received.
|
void |
setState(java.io.InputStream input)
Allows an application to read a state through a provided InputStream.
|
void receive(Message msg)
msg
- void getState(java.io.OutputStream output) throws java.lang.Exception
output
- the OutputStreamjava.lang.Exception
- if the streaming fails, any exceptions should be thrown so that the state requester
can re-throw them and let the caller know what happenedOutputStream.close()
void setState(java.io.InputStream input) throws java.lang.Exception
input
- the InputStreamjava.lang.Exception
- if the streaming fails, any exceptions should be thrown so that the state requester
can catch them and thus know what happenedInputStream.close()
Copyright © 1998-2020 Red Hat. All Rights Reserved.