xmlBlaster 1.6.2 client API

org.xmlBlaster.util.queue
Class BlockingQueueWrapper

java.lang.Object
  extended byorg.xmlBlaster.util.queue.BlockingQueueWrapper
All Implemented Interfaces:
I_StorageSizeListener

public class BlockingQueueWrapper
extends java.lang.Object
implements I_StorageSizeListener

BlockingQueueWrapper is a wrapper to I_Queue which can be used to perform a blocking peek on an I_Queue.

Author:
Michele Laghi

Nested Class Summary
static interface BlockingQueueWrapper.I_BlockingQueueCb
           
 
Constructor Summary
BlockingQueueWrapper()
           
BlockingQueueWrapper(long pollInterval)
          Constructor
 
Method Summary
 java.util.ArrayList blockingPeek(int numOfEntries, long timeout)
           
 java.util.ArrayList blockingPeekLowest(int numOfEntries, long timeout, I_QueueEntry limitEntry)
           
 java.util.ArrayList blockingPeekSamePriority(int numOfEntries, long timeout)
           
 java.util.ArrayList blockingPeekWithPriority(int numOfEntries, long timeout, int minPrio, int maxPrio)
           
 java.util.ArrayList blockingTakeLowest(int numOfEntries, long timeout, I_QueueEntry limitEntry)
           
 java.util.ArrayList blockingTakeWithPriority(int numOfEntries, long timeout, int minPrio, int maxPrio)
           
 void changed(I_Storage storage, long numEntries, long numBytes, boolean isShutdown)
          Enforced by I_StorageSizeListener.
 void clear()
           
 I_Queue getQueue()
           
 void init(I_Queue queue)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingQueueWrapper

public BlockingQueueWrapper(long pollInterval)
Constructor

Parameters:
pollInterval - time in milliseconds to wait before a check about the queue size is done.

BlockingQueueWrapper

public BlockingQueueWrapper()
Method Detail

init

public void init(I_Queue queue)
          throws XmlBlasterException
Throws:
XmlBlasterException

clear

public void clear()

getQueue

public I_Queue getQueue()
Returns:
null after shutdown

shutdown

public void shutdown()

changed

public void changed(I_Storage storage,
                    long numEntries,
                    long numBytes,
                    boolean isShutdown)
Enforced by I_StorageSizeListener.

Specified by:
changed in interface I_StorageSizeListener
Parameters:
numEntries -
numBytes -
isShutdown -
storage - The queue which fires the change event

blockingPeek

public java.util.ArrayList blockingPeek(int numOfEntries,
                                        long timeout)
                                 throws XmlBlasterException
Throws:
XmlBlasterException

blockingTakeLowest

public java.util.ArrayList blockingTakeLowest(int numOfEntries,
                                              long timeout,
                                              I_QueueEntry limitEntry)
                                       throws XmlBlasterException
Throws:
XmlBlasterException

blockingPeekLowest

public java.util.ArrayList blockingPeekLowest(int numOfEntries,
                                              long timeout,
                                              I_QueueEntry limitEntry)
                                       throws XmlBlasterException
Throws:
XmlBlasterException

blockingTakeWithPriority

public java.util.ArrayList blockingTakeWithPriority(int numOfEntries,
                                                    long timeout,
                                                    int minPrio,
                                                    int maxPrio)
                                             throws XmlBlasterException
Throws:
XmlBlasterException

blockingPeekWithPriority

public java.util.ArrayList blockingPeekWithPriority(int numOfEntries,
                                                    long timeout,
                                                    int minPrio,
                                                    int maxPrio)
                                             throws XmlBlasterException
Throws:
XmlBlasterException

blockingPeekSamePriority

public java.util.ArrayList blockingPeekSamePriority(int numOfEntries,
                                                    long timeout)
                                             throws XmlBlasterException
Throws:
XmlBlasterException

xmlBlaster 1.6.2 client API

Copyright © 1999-2007 The xmlBlaster.org contributers.