org.jgroups

Interface MessageListener

Known Subinterfaces:
Receiver
Known Implementing Classes:
Chat, DistributedHashtable, DistributedQueue, DistributedTree, MessageListenerAdapter, NotificationBus, QuoteServer, ReceiverAdapter, ReplicatedHashtable, ReplicatedTree, UDP_NIO, UDP_NIO.ConnectorTable, UDP_NIO.MyReceiver, VotingAdapter, Whiteboard

public interface MessageListener

Allows 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

byte[]
getState()
Answers the group state; e.g., when joining.
void
receive(Message msg)
Called when a message is received.
void
setState(byte[] state)
Sets the group state; e.g., when joining.

Method Details

getState

public byte[] getState()
Answers the group state; e.g., when joining.
Returns:
byte[]

receive

public void receive(Message msg)
Called when a message is received.
Parameters:
msg -

setState

public void setState(byte[] state)
Sets the group state; e.g., when joining.
Parameters:
state -

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.