org.jboss.mq
Class SpyConnectionConsumer

java.lang.Object
  extended byorg.jboss.mq.SpyConnectionConsumer
All Implemented Interfaces:
ConnectionConsumer (src) , java.lang.Runnable, SpyConsumer (src)

public class SpyConnectionConsumer
extends java.lang.Object
implements ConnectionConsumer (src) , SpyConsumer (src) , java.lang.Runnable

This class implements javax.jms.ConnectionConsumer


Constructor Summary
SpyConnectionConsumer(Connection (src)  connection, Destination (src)  destination, java.lang.String messageSelector, ServerSessionPool (src)  serverSessionPool, int maxMessages)
          SpyConnectionConsumer constructor
 
Method Summary
 void addMessage(SpyMessage (src)  mes)
          Add a message
 void close()
          Closes the connection consumer.
 ServerSessionPool (src) getServerSessionPool()
          Gets the server session pool associated with this connection consumer.
 Subscription (src) getSubscription()
          Get the subscription
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpyConnectionConsumer

public SpyConnectionConsumer(Connection (src)  connection,
                             Destination (src)  destination,
                             java.lang.String messageSelector,
                             ServerSessionPool (src)  serverSessionPool,
                             int maxMessages)
                      throws JMSException (src) 
SpyConnectionConsumer constructor

Parameters:
connection - the connection
destination - destination
messageSelector - the message selector
serverSessionPool - the server session pool
maxMessages - the maxmimum messages
Throws:
JMSException (src) - for any error
Method Detail

getSubscription

public Subscription (src)  getSubscription()
Get the subscription

Specified by:
getSubscription in interface SpyConsumer (src)
Returns:
the subscription

addMessage

public void addMessage(SpyMessage (src)  mes)
                throws JMSException (src) 
Add a message

Specified by:
addMessage in interface SpyConsumer (src)
Parameters:
mes - the message
Throws:
JMSException (src) - for any error

getServerSessionPool

public ServerSessionPool (src)  getServerSessionPool()
                                       throws JMSException (src) 
Description copied from interface: ConnectionConsumer (src)
Gets the server session pool associated with this connection consumer.

Specified by:
getServerSessionPool in interface ConnectionConsumer (src)
Returns:
the server session pool used by this connection consumer
Throws:
JMSException (src) - if the JMS provider fails to get the server session pool associated with this consumer due to some internal error.

close

public void close()
           throws JMSException (src) 
Description copied from interface: ConnectionConsumer (src)
Closes the connection consumer.

Since a provider may allocate some resources on behalf of a connection consumer outside the Java virtual machine, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Specified by:
close in interface ConnectionConsumer (src)
Throws:
JMSException (src) - if the JMS provider fails to release resources on behalf of the connection consumer or fails to close the connection consumer.

run

public void run()
Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()