Package org.jgroups
Interface MessageListener
-
- All Known Subinterfaces:
ExtendedMessageListener,ExtendedReceiver,Receiver
- All Known Implementing Classes:
Chat,ChatCore,DistributedHashtable,DistributedQueue,DistributedTree,Draw,ExtendedReceiverAdapter,MessageListenerAdapter,NotificationBus,QuoteServer,ReceiverAdapter,ReplicatedHashMap,ReplicatedHashtable,ReplicatedTree,ViewDemo,VotingAdapter,Whiteboard
public interface MessageListenerAllows a listener to be notified when a message arrives. Contrary to the pull-style of channels, some building blocks (e.g.,PullPushAdapter) provide an event-like, push-style message delivery model. In this case, the entity to be notified of message reception needs to provide a callback to be invoked whenever a message has been received. The MessageListener interface provides a method to do so.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]getState()Answers the group state; e.g., when joining.voidreceive(Message msg)Called when a message is received.voidsetState(byte[] state)Sets the group state; e.g., when joining.
-
-
-
Method Detail
-
receive
void receive(Message msg)
Called when a message is received.- Parameters:
msg-
-
getState
byte[] getState()
Answers the group state; e.g., when joining.- Returns:
- byte[]
-
setState
void setState(byte[] state)
Sets the group state; e.g., when joining.- Parameters:
state-
-
-