OSMQ
v2.0.1

osmq.broker.subqueues
Class SubscriberQueues

java.lang.Object
  extended byosmq.broker.subqueues.SubscriberQueues
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TopicalSubscriberQueues

public class SubscriberQueues
extends java.lang.Object
implements java.io.Serializable

Multi-queue object, where each queue is identified by a unique string key value. If a queue is searched and not found, a new queue related to the string value is instantiated. Queues are never destroyed -- they are closed. This class is never instantiated, but is the base class to the Topical SubscriberQueues.

See Also:
Serialized Form

Constructor Summary
SubscriberQueues()
           
 
Method Summary
 SubscriberQueue createQueue(java.lang.String key)
          Unconditionally creates a name Queue associated with the value key.
 SubscriberQueue findOrCreate(java.lang.String key)
          Return the Queue associated with a key.
 SubscriberQueue findOrCreateAndLoad(java.lang.String key)
          Return the Queue associated with a key.
 SubscriberQueue findQueue(java.lang.String key)
          Locate a Queue associated with the value key.
 QueueStats getConsolidatedSize(QueueStats counts)
          Return the consolidated number of element contained in all the queues contained in the set.
 SubscriberQueue getCurrentFifo(java.lang.String key)
           
 java.util.Iterator getIterator()
           
 int getQueueCount()
           
 byte[] pullFromNamedQueue(java.lang.String key)
          Get the next message value from the queue associated with a key value.
 void put(byte[] value, java.lang.String key)
          Puts a value onto a named Queue.
 void setAllHaltReads(boolean halt)
           
 void setAllHaltWrites(boolean halt)
           
 void setThresholdOverride(int thresholdoverride)
           
 long size(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriberQueues

public SubscriberQueues()
Method Detail

setThresholdOverride

public final void setThresholdOverride(int thresholdoverride)

put

public final void put(byte[] value,
                      java.lang.String key)
               throws java.io.IOException
Puts a value onto a named Queue.

Throws:
java.io.IOException

pullFromNamedQueue

public final byte[] pullFromNamedQueue(java.lang.String key)
                                throws java.io.IOException
Get the next message value from the queue associated with a key value.

Throws:
java.io.IOException

size

public final long size(java.lang.String key)

getIterator

public final java.util.Iterator getIterator()

setAllHaltReads

public final void setAllHaltReads(boolean halt)

setAllHaltWrites

public final void setAllHaltWrites(boolean halt)

getConsolidatedSize

public final QueueStats getConsolidatedSize(QueueStats counts)
Return the consolidated number of element contained in all the queues contained in the set.


getQueueCount

public final int getQueueCount()

getCurrentFifo

public final SubscriberQueue getCurrentFifo(java.lang.String key)

findOrCreateAndLoad

public SubscriberQueue findOrCreateAndLoad(java.lang.String key)
Return the Queue associated with a key. If one is not found, create one.

If a new Queue is created, look for a file with a corresponding name. If one is found, load the values from that file into the Queue


findOrCreate

public SubscriberQueue findOrCreate(java.lang.String key)
Return the Queue associated with a key. If one is not found, create one.


createQueue

public SubscriberQueue createQueue(java.lang.String key)
Unconditionally creates a name Queue associated with the value key. It then places an entry in the map that associates the name with the key.


findQueue

public SubscriberQueue findQueue(java.lang.String key)
Locate a Queue associated with the value key. If none is found, the method returns null.


(c) 2000 - 2003 MQue Systems
All Rights Reserved