org.jboss.jms.client
Class JBossConnectionConsumer

java.lang.Object
  extended byorg.jboss.jms.client.JBossConnectionConsumer
All Implemented Interfaces:
java.lang.Runnable

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

This class implements javax.jms.ConnectionConsumer

Version:
$Revision: 1569 $ $Id: JBossConnectionConsumer.java 1569 2006-11-17 02:08:56Z ovidiu.feodorov@jboss.com $
Author:
Tim Fox, Ovidiu Feodorov Partially based on JBossMQ version by:, Hiram Chirino (Cojonudo14@hotmail.com), Adrian Brock

Field Summary
protected  boolean closed
          Is the ConnectionConsumer closed?
protected  java.lang.Object closeLock
           
protected  ConsumerDelegate cons
           
protected  int consumerID
           
protected  Destination destination
          The destination this consumer will receive messages from
protected  int id
          The thread id
protected  java.lang.Thread internalThread
          The "listening" thread that gets messages from destination and queues them for delivery to sessions
protected  int maxDeliveries
           
protected  int maxMessages
          The maximum number of messages that a single session will be loaded with.
protected  ServerSessionPool serverSessionPool
          The ServerSessionPool that is implemented by the AS
protected  SessionDelegate sess
           
protected static SynchronizedInt threadId
          The thread id generator
 
Constructor Summary
JBossConnectionConsumer(ConnectionDelegate conn, JBossDestination dest, java.lang.String subName, java.lang.String messageSelector, ServerSessionPool sessPool, int maxMessages)
          JBossConnectionConsumer constructor
 
Method Summary
 void close()
           
protected  void doClose()
           
 ServerSessionPool getServerSessionPool()
           
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cons

protected ConsumerDelegate cons

sess

protected SessionDelegate sess

consumerID

protected int consumerID

destination

protected Destination destination
The destination this consumer will receive messages from


serverSessionPool

protected ServerSessionPool serverSessionPool
The ServerSessionPool that is implemented by the AS


maxMessages

protected int maxMessages
The maximum number of messages that a single session will be loaded with.


closed

protected volatile boolean closed
Is the ConnectionConsumer closed?


internalThread

protected java.lang.Thread internalThread
The "listening" thread that gets messages from destination and queues them for delivery to sessions


id

protected int id
The thread id


threadId

protected static SynchronizedInt threadId
The thread id generator


closeLock

protected java.lang.Object closeLock

maxDeliveries

protected int maxDeliveries
Constructor Detail

JBossConnectionConsumer

public JBossConnectionConsumer(ConnectionDelegate conn,
                               JBossDestination dest,
                               java.lang.String subName,
                               java.lang.String messageSelector,
                               ServerSessionPool sessPool,
                               int maxMessages)
                        throws JMSException
JBossConnectionConsumer constructor

Parameters:
conn - the connection
dest - destination
messageSelector - the message selector
sessPool - the server session pool
maxMessages - the maxmimum messages
Throws:
JMSException - for any error
Method Detail

getServerSessionPool

public ServerSessionPool getServerSessionPool()
                                       throws JMSException
Throws:
JMSException

close

public void close()
           throws JMSException
Throws:
JMSException

run

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

doClose

protected void doClose()
                throws JMSException
Throws:
JMSException

toString

public java.lang.String toString()


Copyright © 2006 JBoss Inc. All Rights Reserved.