org.jboss.messaging.core.impl
Class MessagingQueue

java.lang.Object
  extended by org.jboss.messaging.core.impl.ChannelSupport
      extended by org.jboss.messaging.core.impl.PagingChannelSupport
          extended by org.jboss.messaging.core.impl.MessagingQueue
All Implemented Interfaces:
Channel, DeliveryObserver, Queue, Receiver

public class MessagingQueue
extends PagingChannelSupport
implements Queue

A MessagingQueue Can be used to implement a point to point queue, or a subscription fed from a topic

Version:
$Revision: 1295 $ $Id: Queue.java 1295 2006-09-15 17:44:02Z timfox $
Author:
Ovidiu Feodorov, Tim Fox

Nested Class Summary
protected  class MessagingQueue.DistributorWrapper
           
 
Field Summary
protected  boolean clustered
           
protected  Filter filter
           
protected  Distributor localDistributor
           
protected  java.lang.String name
           
protected  Distributor remoteDistributor
           
 
Fields inherited from class org.jboss.messaging.core.impl.PagingChannelSupport
downCache, downCacheSize, firstPagingOrder, fullSize, ms, nextPagingOrder, pageSize, paging
 
Fields inherited from class org.jboss.messaging.core.impl.ChannelSupport
active, channelID, deliveringCount, distributor, lock, maxSize, messageRefs, messagesAdded, pm, receiversReady, recoverable, scheduledDeliveries
 
Constructor Summary
MessagingQueue(int nodeID, java.lang.String name, long id, boolean recoverable, Filter filter, boolean clustered)
           
MessagingQueue(int nodeID, java.lang.String name, long id, MessageStore ms, PersistenceManager pm, boolean recoverable, Filter filter, boolean clustered)
          This constructor is used when loading queue from storage - the paging params, maxSize and recoverDeliveriesTimeout don't matter they are injected when the queue or topic service is started
MessagingQueue(int nodeID, java.lang.String name, long id, MessageStore ms, PersistenceManager pm, boolean recoverable, int maxSize, Filter filter, boolean clustered)
           
MessagingQueue(int nodeID, java.lang.String name, long id, MessageStore ms, PersistenceManager pm, boolean recoverable, int maxSize, Filter filter, int fullSize, int pageSize, int downCacheSize, boolean clustered, long recoverDeliveriesTimeout)
           
 
Method Summary
 void addAllToRecoveryArea(int nodeID, java.util.Map ids)
           
 void addToRecoveryArea(int nodeID, long messageID, java.lang.String sessionID)
           
protected  void deliverInternal()
          This methods delivers as many messages as possible to the distributor until no more deliveries are returned.
 boolean equals(java.lang.Object other)
           
 int getDownCacheSize()
           
 Filter getFilter()
           
 int getFullSize()
           
 Distributor getLocalDistributor()
           
 java.lang.String getName()
           
 int getNodeID()
           
 int getPageSize()
           
 long getRecoverDeliveriesTimeout()
           
 java.util.Map getRecoveryArea()
           
 int getRecoveryMapSize()
           
 Distributor getRemoteDistributor()
           
 boolean isClustered()
           
 void mergeIn(long theChannelID, int nodeID)
          Merge the contents of one queue with another - this happens at failover when a queue is failed over to another node, but a queue with the same name already exists.
 java.util.List recoverDeliveries(java.util.List messageIds)
           
 void registerSucker(MessageSucker sucker)
           
 void removeAllFromRecoveryArea(int nodeID)
           
 void removeFromRecoveryArea(int nodeID, long messageID)
           
 void removeStrandedReferences(java.lang.String sessionID)
           
protected  void setReceiversReady(boolean receiversReady)
           
 java.lang.String toString()
           
 boolean unregisterSucker(MessageSucker sucker)
           
 
Methods inherited from class org.jboss.messaging.core.impl.PagingChannelSupport
addFromRefInfo, addReferenceInMemory, addToDownCache, cancelInternal, doLoad, downCacheCount, flushDownCache, getMessageCount, isPaging, load, loadPagedReferences, processReferences, removeFirstInMemory, setPagingParams, unload
 
Methods inherited from class org.jboss.messaging.core.impl.ChannelSupport
acknowledge, acknowledgeInternal, activate, browse, cancel, checkAndSchedule, checkClosed, clearAllScheduledDeliveries, close, deactivate, deliver, deliverScheduled, getCallback, getChannelID, getDeliveringCount, getMaxSize, getMessagesAdded, getReceiversReady, getScheduledCount, handle, handleInternal, isActive, isRecoverable, memoryRefCount, processMessageBeforeStorage, removeAllReferences, setMaxSize, undelivered
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.messaging.core.contract.Queue
setPagingParams
 
Methods inherited from interface org.jboss.messaging.core.contract.Channel
activate, browse, close, deactivate, deliver, getChannelID, getDeliveringCount, getMaxSize, getMessageCount, getMessagesAdded, getScheduledCount, isActive, isRecoverable, load, removeAllReferences, setMaxSize, unload
 
Methods inherited from interface org.jboss.messaging.core.contract.DeliveryObserver
acknowledge, cancel
 
Methods inherited from interface org.jboss.messaging.core.contract.Receiver
handle
 

Field Detail

name

protected java.lang.String name

filter

protected Filter filter

clustered

protected boolean clustered

remoteDistributor

protected Distributor remoteDistributor

localDistributor

protected Distributor localDistributor
Constructor Detail

MessagingQueue

public MessagingQueue(int nodeID,
                      java.lang.String name,
                      long id,
                      MessageStore ms,
                      PersistenceManager pm,
                      boolean recoverable,
                      int maxSize,
                      Filter filter,
                      int fullSize,
                      int pageSize,
                      int downCacheSize,
                      boolean clustered,
                      long recoverDeliveriesTimeout)

MessagingQueue

public MessagingQueue(int nodeID,
                      java.lang.String name,
                      long id,
                      MessageStore ms,
                      PersistenceManager pm,
                      boolean recoverable,
                      Filter filter,
                      boolean clustered)
This constructor is used when loading queue from storage - the paging params, maxSize and recoverDeliveriesTimeout don't matter they are injected when the queue or topic service is started


MessagingQueue

public MessagingQueue(int nodeID,
                      java.lang.String name,
                      long id,
                      MessageStore ms,
                      PersistenceManager pm,
                      boolean recoverable,
                      int maxSize,
                      Filter filter,
                      boolean clustered)

MessagingQueue

public MessagingQueue(int nodeID,
                      java.lang.String name,
                      long id,
                      boolean recoverable,
                      Filter filter,
                      boolean clustered)
Method Detail

getNodeID

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

getName

public java.lang.String getName()
Specified by:
getName in interface Queue

getFilter

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

isClustered

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

getLocalDistributor

public Distributor getLocalDistributor()
Specified by:
getLocalDistributor in interface Queue

getRemoteDistributor

public Distributor getRemoteDistributor()
Specified by:
getRemoteDistributor in interface Queue

mergeIn

public void mergeIn(long theChannelID,
                    int nodeID)
             throws java.lang.Exception
Merge the contents of one queue with another - this happens at failover when a queue is failed over to another node, but a queue with the same name already exists. In this case we merge the two queues.

Specified by:
mergeIn in interface Queue
Throws:
java.lang.Exception

recoverDeliveries

public java.util.List recoverDeliveries(java.util.List messageIds)
Specified by:
recoverDeliveries in interface Queue

removeStrandedReferences

public void removeStrandedReferences(java.lang.String sessionID)
Specified by:
removeStrandedReferences in interface Queue

registerSucker

public void registerSucker(MessageSucker sucker)
Specified by:
registerSucker in interface Queue

unregisterSucker

public boolean unregisterSucker(MessageSucker sucker)
Specified by:
unregisterSucker in interface Queue

getFullSize

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

getPageSize

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

getDownCacheSize

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

addToRecoveryArea

public void addToRecoveryArea(int nodeID,
                              long messageID,
                              java.lang.String sessionID)
Specified by:
addToRecoveryArea in interface Queue

removeFromRecoveryArea

public void removeFromRecoveryArea(int nodeID,
                                   long messageID)
Specified by:
removeFromRecoveryArea in interface Queue

removeAllFromRecoveryArea

public void removeAllFromRecoveryArea(int nodeID)
Specified by:
removeAllFromRecoveryArea in interface Queue

addAllToRecoveryArea

public void addAllToRecoveryArea(int nodeID,
                                 java.util.Map ids)
Specified by:
addAllToRecoveryArea in interface Queue

getRecoverDeliveriesTimeout

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

getRecoveryArea

public java.util.Map getRecoveryArea()
Specified by:
getRecoveryArea in interface Queue

getRecoveryMapSize

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

deliverInternal

protected void deliverInternal()
Description copied from class: ChannelSupport
This methods delivers as many messages as possible to the distributor until no more deliveries are returned. This method should never be called at the same time as handle.

Overrides:
deliverInternal in class ChannelSupport
See Also:
Channel.deliver()

setReceiversReady

protected void setReceiversReady(boolean receiversReady)
Overrides:
setReceiversReady in class ChannelSupport

toString

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

equals

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


Copyright © 2006 JBoss Inc. All Rights Reserved.