Class PullPushAdapter
java.lang.Object
org.jgroups.blocks.PullPushAdapter
- All Implemented Interfaces:
Runnable, ChannelListener
Deprecated.
Allows a client of
Channel to be notified when messages have been received
instead of having to actively poll the channel for new messages. Typically used in the
client role (receive()). As this class does not implement interface
Transport, but uses it for receiving messages, an underlying object
has to be used to send messages (e.g. the channel on which an object of this class relies).Multiple MembershipListeners can register with the PullPushAdapter; when a view is received, they will all be notified. There is one main message listener which sends and receives message. In addition, MessageListeners can register with a certain tag (identifier), and then send messages tagged with this identifier. When a message with such an identifier is received, the corresponding MessageListener will be looked up and the message dispatched to it. If no tag is found (default), the main MessageListener will receive the message.
- Version:
- $Revision
- Author:
- Bela Ban
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MessageListenerDeprecated.protected final HashMapDeprecated.protected final org.apache.commons.logging.LogDeprecated.protected final ListDeprecated.protected ThreadDeprecated.protected TransportDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionPullPushAdapter(Transport transport) Deprecated.PullPushAdapter(Transport transport, MembershipListener ml) Deprecated.PullPushAdapter(Transport transport, MessageListener l) Deprecated.PullPushAdapter(Transport transport, MessageListener l, MembershipListener ml) Deprecated.PullPushAdapter(Transport transport, MessageListener l, MembershipListener ml, boolean start) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidDeprecated.voidchannelClosed(Channel channel) Deprecated.voidchannelConnected(Channel channel) Deprecated.voidchannelDisconnected(Channel channel) Deprecated.voidchannelReconnected(Address addr) Deprecated.voidDeprecated.Deprecated.Deprecated.protected voidhandleMessage(Message msg) Deprecated.Check whether the message has an identifier.protected voidDeprecated.protected voidnotifySuspect(Address suspected_mbr) Deprecated.protected voidDeprecated.protected voidDeprecated.voidregisterListener(Serializable identifier, MessageListener l) Deprecated.Sets a listener to messages with a given identifier.voidDeprecated.voidrun()Deprecated.Reentrant run(): message reception is serialized, then the listener is notified of the message receptionvoidsend(Serializable identifier, Message msg) Deprecated.Sends a message to the group - listeners to this identifier will receive the messages.voidDeprecated.Sends a message with no identifier; listener member will get this message on the other group members.final voidDeprecated.voidDeprecated.final voidstart()Deprecated.voidstop()Deprecated.voidunregisterListener(Serializable identifier) Deprecated.Removes a message listener to a given identifier from the message listeners map.
-
Field Details
-
transport
Deprecated. -
listener
Deprecated. -
membership_listeners
Deprecated. -
receiver_thread
Deprecated. -
listeners
Deprecated. -
log
protected final org.apache.commons.logging.Log logDeprecated.
-
-
Constructor Details
-
PullPushAdapter
Deprecated. -
PullPushAdapter
Deprecated. -
PullPushAdapter
Deprecated. -
PullPushAdapter
Deprecated. -
PullPushAdapter
public PullPushAdapter(Transport transport, MessageListener l, MembershipListener ml, boolean start) Deprecated.
-
-
Method Details
-
getTransport
Deprecated. -
start
public final void start()Deprecated. -
stop
public void stop()Deprecated. -
send
Deprecated.Sends a message to the group - listeners to this identifier will receive the messages.- Parameters:
identifier- the key that the proper listeners are listenting onmsg- the Message to be sent- Throws:
Exception- See Also:
-
send
-
setListener
Deprecated. -
registerListener
Deprecated.Sets a listener to messages with a given identifier. Messages sent with this identifier in their headers will be routed to this listener. Note: there can be only one listener for one identifier; if you want to register a different listener to an already registered identifier, then unregister first.- Parameters:
identifier- - messages sent on the group with this object will be received by this listenerl- - the listener that will get the message
-
unregisterListener
Deprecated.Removes a message listener to a given identifier from the message listeners map.- Parameters:
identifier- - the key to whom we do not want to listen any more
-
setMembershipListener
Deprecated. -
addMembershipListener
Deprecated. -
removeMembershipListener
Deprecated. -
run
-
handleMessage
Deprecated.Check whether the message has an identifier. If yes, lookup the MessageListener associated with the given identifier in the hashtable and dispatch to it. Otherwise just use the main (default) message listener -
notifyViewChange
Deprecated. -
notifySuspect
Deprecated. -
notifyBlock
protected void notifyBlock()Deprecated. -
notifyUnblock
protected void notifyUnblock()Deprecated. -
channelConnected
Deprecated.- Specified by:
channelConnectedin interfaceChannelListener
-
channelDisconnected
Deprecated.- Specified by:
channelDisconnectedin interfaceChannelListener
-
channelClosed
Deprecated.- Specified by:
channelClosedin interfaceChannelListener
-
channelShunned
-
channelReconnected
Deprecated.- Specified by:
channelReconnectedin interfaceChannelListener
-
getListener
-
Receiverinstead, this class will be removed in JGroups 3.0