com.caucho.jms.queue
Class AbstractQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue
          extended by com.caucho.jms.queue.AbstractDestination
              extended by com.caucho.jms.queue.AbstractQueue
All Implemented Interfaces:
HandleAware, java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.concurrent.BlockingQueue, java.util.Queue, Destination
Direct Known Subclasses:
ClientSubscriber, ClientTopicSubscriber, FileQueue, MemoryQueue, PollingQueue, ServerQueue

public abstract class AbstractQueue
extends AbstractDestination
implements Queue

Implements an abstract queue.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.jms.queue.AbstractDestination
_messageFactory
 
Constructor Summary
protected AbstractQueue()
           
 
Method Summary
 void addListenerException(java.lang.Exception e)
          Called when a listener throws an excepton
 void addMessageAvailableListener(MessageAvailableListener listener)
          Adds a MessageAvailableListener to receive notifications for new messages.
 void close()
           
 java.util.ArrayList<MessageImpl> getBrowserList()
           
 int getConsumerCount()
          Returns the number of active message consumers
 long getListenerFailCountTotal()
          Returns the number of listener failures.
 long getListenerFailLastTime()
          Returns the number of listener failures.
 int getQueueSize()
          Returns the queue size
 void init()
           
protected  void notifyMessageAvailable()
           
 void postConstruct()
           
 void removeMessageAvailableListener(MessageAvailableListener consumer)
          Removes the consumer receiving messages.
 void setQueueName(java.lang.String name)
           
protected  void startPoll()
           
protected  void stopPoll()
           
 
Methods inherited from class com.caucho.jms.queue.AbstractDestination
acknowledge, drainTo, drainTo, generateMessageID, generateMessageID, getJMSDestination, getName, getQueueName, getReadConsumer, getTopicName, getUrl, getWriteSession, hasMessage, iterator, offer, offer, peek, poll, poll, put, receive, remainingCapacity, rollback, send, setName, setSerializationHandle, size, take, toString
 
Methods inherited from class java.util.AbstractQueue
add, addAll, clear, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.Queue
getQueueName, toString
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

AbstractQueue

protected AbstractQueue()
Method Detail

setQueueName

public void setQueueName(java.lang.String name)

getConsumerCount

public int getConsumerCount()
Returns the number of active message consumers


getQueueSize

public int getQueueSize()
Returns the queue size


getListenerFailCountTotal

public long getListenerFailCountTotal()
Returns the number of listener failures.


getListenerFailLastTime

public long getListenerFailLastTime()
Returns the number of listener failures.


init

public void init()

postConstruct

public void postConstruct()

addMessageAvailableListener

public void addMessageAvailableListener(MessageAvailableListener listener)
Adds a MessageAvailableListener to receive notifications for new messages. The listener will spawn or wake a thread to process the message. The listener MUST NOT use the event thread to process the message.

Overrides:
addMessageAvailableListener in class AbstractDestination
Parameters:
listener - notification listener

removeMessageAvailableListener

public void removeMessageAvailableListener(MessageAvailableListener consumer)
Description copied from class: AbstractDestination
Removes the consumer receiving messages.

Overrides:
removeMessageAvailableListener in class AbstractDestination

notifyMessageAvailable

protected void notifyMessageAvailable()

getBrowserList

public java.util.ArrayList<MessageImpl> getBrowserList()

startPoll

protected void startPoll()

stopPoll

protected void stopPoll()

addListenerException

public void addListenerException(java.lang.Exception e)
Called when a listener throws an excepton


close

public void close()
Overrides:
close in class AbstractDestination