org.apache.qpid.server.queue
Class SubscriptionImpl

java.lang.Object
  extended by org.apache.qpid.server.queue.SubscriptionImpl
All Implemented Interfaces:
Subscription

public class SubscriptionImpl
extends java.lang.Object
implements Subscription

Encapsulation of a supscription to a queue.

Ties together the protocol session of a subscriber, the consumer tag that was given out by the broker and the channel id.


Nested Class Summary
static class SubscriptionImpl.Factory
           
 
Field Summary
 AMQChannel channel
           
 java.lang.String consumerTag
           
 AMQProtocolSession protocolSession
           
 
Constructor Summary
SubscriptionImpl(int channel, AMQProtocolSession protocolSession, java.lang.String consumerTag)
           
SubscriptionImpl(int channelId, AMQProtocolSession protocolSession, java.lang.String consumerTag, boolean acks)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean isSuspended()
           
 void queueDeleted(AMQQueue queue)
          Callback indicating that a queue has been deleted.
 void send(AMQMessage msg, AMQQueue queue)
          This method can be called by each of the publisher threads.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

channel

public final AMQChannel channel

protocolSession

public final AMQProtocolSession protocolSession

consumerTag

public final java.lang.String consumerTag
Constructor Detail

SubscriptionImpl

public SubscriptionImpl(int channelId,
                        AMQProtocolSession protocolSession,
                        java.lang.String consumerTag,
                        boolean acks)
                 throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException

SubscriptionImpl

public SubscriptionImpl(int channel,
                        AMQProtocolSession protocolSession,
                        java.lang.String consumerTag)
                 throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

send

public void send(AMQMessage msg,
                 AMQQueue queue)
          throws FailedDequeueException
This method can be called by each of the publisher threads. As a result all changes to the channel object must be thread safe.

Specified by:
send in interface Subscription
Parameters:
msg -
queue -
Throws:
org.apache.qpid.AMQException
FailedDequeueException

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface Subscription

queueDeleted

public void queueDeleted(AMQQueue queue)
Callback indicating that a queue has been deleted.

Specified by:
queueDeleted in interface Subscription
Parameters:
queue -