org.jboss.messaging.core.server.impl
Class QueueImpl_c

java.lang.Object
  extended by org.jboss.messaging.core.server.impl.QueueImpl_c
All Implemented Interfaces:
Queue

public class QueueImpl_c
extends java.lang.Object
implements Queue

Implementation of a Queue TODO use Java 5 concurrent queue

Author:
Tim Fox, Andy Taylor

Field Summary
 
Fields inherited from interface org.jboss.messaging.core.server.Queue
NUM_PRIORITIES
 
Constructor Summary
QueueImpl_c(long persistenceID, SimpleString name, Filter filter, boolean clustered, boolean durable, boolean temporary, int maxSizeBytes, java.util.concurrent.ScheduledExecutorService scheduledExecutor)
           
 
Method Summary
 void addConsumer(Consumer consumer)
           
 HandleStatus addFirst(MessageReference ref)
           
 HandleStatus addLast(MessageReference ref)
           
 void addListFirst(java.util.LinkedList<MessageReference> list)
          This method is used to add a List of MessageReferences atomically at the head of the list.
 void deleteAllReferences(StorageManager storageManager)
           
 void deliver()
           
 void deliverAsync(java.util.concurrent.Executor executor)
           
 boolean equals(java.lang.Object other)
           
 int getConsumerCount()
           
 int getDeliveringCount()
           
 DistributionPolicy getDistributionPolicy()
           
 Filter getFilter()
           
 FlowController getFlowController()
           
 int getMaxSizeBytes()
           
 int getMessageCount()
           
 int getMessagesAdded()
           
 SimpleString getName()
           
 long getPersistenceID()
           
 MessageReference getReference(long id)
           
 int getScheduledCount()
           
 int getSizeBytes()
           
 int hashCode()
           
 boolean isClustered()
           
 boolean isDurable()
           
 boolean isTemporary()
           
 java.util.List<MessageReference> list(Filter filter)
           
 void referenceAcknowledged(MessageReference ref)
           
 void referenceCancelled()
           
 boolean removeConsumer(Consumer consumer)
           
 boolean removeReferenceWithID(long id)
           
 void setDistributionPolicy(DistributionPolicy distributionPolicy)
           
 void setFilter(Filter filter)
           
 void setFlowController(FlowController flowController)
           
 void setPersistenceID(long id)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueImpl_c

public QueueImpl_c(long persistenceID,
                   SimpleString name,
                   Filter filter,
                   boolean clustered,
                   boolean durable,
                   boolean temporary,
                   int maxSizeBytes,
                   java.util.concurrent.ScheduledExecutorService scheduledExecutor)
Method Detail

isClustered

public boolean isClustered()
Specified by:
isClustered in interface Queue

isDurable

public boolean isDurable()
Specified by:
isDurable in interface Queue

isTemporary

public boolean isTemporary()
Specified by:
isTemporary in interface Queue

getName

public SimpleString getName()
Specified by:
getName in interface Queue

addLast

public HandleStatus addLast(MessageReference ref)
Specified by:
addLast in interface Queue

addFirst

public HandleStatus addFirst(MessageReference ref)
Specified by:
addFirst in interface Queue

addListFirst

public void addListFirst(java.util.LinkedList<MessageReference> list)
Description copied from interface: Queue
This method is used to add a List of MessageReferences atomically at the head of the list. Useful when cancelling messages and guaranteeing ordering

Specified by:
addListFirst in interface Queue

deliverAsync

public void deliverAsync(java.util.concurrent.Executor executor)
Specified by:
deliverAsync in interface Queue

deliver

public void deliver()
Specified by:
deliver in interface Queue

addConsumer

public void addConsumer(Consumer consumer)
Specified by:
addConsumer in interface Queue

removeConsumer

public boolean removeConsumer(Consumer consumer)
Specified by:
removeConsumer in interface Queue

getConsumerCount

public int getConsumerCount()
Specified by:
getConsumerCount in interface Queue

list

public java.util.List<MessageReference> list(Filter filter)
Specified by:
list in interface Queue

removeReferenceWithID

public boolean removeReferenceWithID(long id)
Specified by:
removeReferenceWithID in interface Queue

getReference

public MessageReference getReference(long id)
Specified by:
getReference in interface Queue

getPersistenceID

public long getPersistenceID()
Specified by:
getPersistenceID in interface Queue

setPersistenceID

public void setPersistenceID(long id)
Specified by:
setPersistenceID in interface Queue

getFilter

public Filter getFilter()
Specified by:
getFilter in interface Queue

setFilter

public void setFilter(Filter filter)
Specified by:
setFilter in interface Queue

getMessageCount

public int getMessageCount()
Specified by:
getMessageCount in interface Queue

getScheduledCount

public int getScheduledCount()
Specified by:
getScheduledCount in interface Queue

getDeliveringCount

public int getDeliveringCount()
Specified by:
getDeliveringCount in interface Queue

referenceAcknowledged

public void referenceAcknowledged(MessageReference ref)
                           throws java.lang.Exception
Specified by:
referenceAcknowledged in interface Queue
Throws:
java.lang.Exception

referenceCancelled

public void referenceCancelled()
Specified by:
referenceCancelled in interface Queue

getMaxSizeBytes

public int getMaxSizeBytes()
Specified by:
getMaxSizeBytes in interface Queue

getSizeBytes

public int getSizeBytes()
Specified by:
getSizeBytes in interface Queue

getDistributionPolicy

public DistributionPolicy getDistributionPolicy()
Specified by:
getDistributionPolicy in interface Queue

setDistributionPolicy

public void setDistributionPolicy(DistributionPolicy distributionPolicy)
Specified by:
setDistributionPolicy in interface Queue

getMessagesAdded

public int getMessagesAdded()
Specified by:
getMessagesAdded in interface Queue

setFlowController

public void setFlowController(FlowController flowController)
Specified by:
setFlowController in interface Queue

getFlowController

public FlowController getFlowController()
Specified by:
getFlowController in interface Queue

deleteAllReferences

public void deleteAllReferences(StorageManager storageManager)
                         throws java.lang.Exception
Specified by:
deleteAllReferences in interface Queue
Throws:
java.lang.Exception

equals

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

hashCode

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


Copyright © 2006 JBoss Inc. All Rights Reserved.