JavaGroups
Class PullPushAdapter

java.lang.Object
  |
  +--JavaGroups.PullPushAdapter

public class PullPushAdapter
extends java.lang.Object
implements java.lang.Runnable

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).


Constructor Summary
PullPushAdapter(Transport transport)
           
PullPushAdapter(Transport transport, MembershipListener ml)
           
PullPushAdapter(Transport transport, MessageListener l)
           
PullPushAdapter(Transport transport, MessageListener l, MembershipListener ml)
           
 
Method Summary
 void run()
          Reentrant run(): message reception is serialized, then the listener is notified of the message reception
 void SetListener(MessageListener l)
           
 void SetMembershipListener(MembershipListener ml)
           
 void Start()
           
 void Stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PullPushAdapter

public PullPushAdapter(Transport transport)

PullPushAdapter

public PullPushAdapter(Transport transport,
                       MessageListener l)

PullPushAdapter

public PullPushAdapter(Transport transport,
                       MembershipListener ml)

PullPushAdapter

public PullPushAdapter(Transport transport,
                       MessageListener l,
                       MembershipListener ml)
Method Detail

Start

public void Start()

Stop

public void Stop()

SetListener

public void SetListener(MessageListener l)

SetMembershipListener

public void SetMembershipListener(MembershipListener ml)

run

public void run()
Reentrant run(): message reception is serialized, then the listener is notified of the message reception
Specified by:
run in interface java.lang.Runnable