org.apache.qpid.server.cluster
Class MinaBrokerProxy

java.lang.Object
  extended by org.apache.qpid.server.cluster.SimpleMemberHandle
      extended by org.apache.qpid.server.cluster.MinaBrokerProxy
All Implemented Interfaces:
Member, MemberHandle

public class MinaBrokerProxy
extends SimpleMemberHandle

A 'client stub' for a remote cluster peer, using MINA for IO Layer


Method Summary
 void addFailureListener(org.apache.qpid.server.cluster.MemberFailureListener listener)
          Allows a listener to be registered that will receive callbacks when communication to the peer this broker instance represents fails.
protected  void failed()
          Allows subclasses to signal comunication failures
 void handle(int channel, org.apache.qpid.framing.AMQMethodBody method)
           
protected  boolean handleResponse(int channel, org.apache.qpid.framing.AMQMethodBody response)
          Subclasses should call this on receiving message responses from the remote peer.
 void send(org.apache.qpid.framing.AMQDataBlock data)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.qpid.server.cluster.SimpleMemberHandle
equals, getDetails, getHost, getPort, hashCode, matches, matches, resolve, resolve
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.server.cluster.MemberHandle
getDetails, getHost, getPort, matches, matches
 

Method Detail

send

public void send(org.apache.qpid.framing.AMQDataBlock data)
          throws org.apache.qpid.AMQException
Specified by:
send in interface Member
Throws:
org.apache.qpid.AMQException

handle

public void handle(int channel,
                   org.apache.qpid.framing.AMQMethodBody method)
            throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException

toString

public java.lang.String toString()
Overrides:
toString in class SimpleMemberHandle

addFailureListener

public void addFailureListener(org.apache.qpid.server.cluster.MemberFailureListener listener)
Allows a listener to be registered that will receive callbacks when communication to the peer this broker instance represents fails.

Specified by:
addFailureListener in interface Member
Parameters:
listener - the callback to be notified of failures

failed

protected void failed()
Allows subclasses to signal comunication failures


handleResponse

protected boolean handleResponse(int channel,
                                 org.apache.qpid.framing.AMQMethodBody response)
Subclasses should call this on receiving message responses from the remote peer. They are matched to any outstanding request they might be response to, with the completion and callback of that request being managed if required.

Parameters:
channel - the channel on which the method was received
response - the response received
Returns:
true if the response matched an outstanding request