Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.message.util
Class SpooledBoundedPacketQueue

    java.lang.Object
      org.codehaus.activemq.message.util.SpooledBoundedPacketQueue

All Implemented Interfaces:
  BoundedPacketQueue

public class SpooledBoundedPacketQueue
extends java.lang.Object
implements BoundedPacketQueue

Implements a controlled thread safe queue, with Packets being spooled to disk for reading asynchronously.

Constructor Summary
`SpooledBoundedPacketQueue(java.io.File dir, java.lang.String name)` Constructor for SpooledBoundedPacketQueue
`SpooledBoundedPacketQueue(java.io.File dir, java.lang.String name, long maxDataLength, int maxBlockSize)` Constructor for SpooledBoundedPacketQueue

Method Summary
`void` | `clear()` clear the queue
`void` | `close()` close this queue
`Packet` | `dequeue()`
`Packet` | `dequeue(long timeInMillis)` Dequeues a Packet from the head of the queue
`Packet` | `dequeueNoWait()` dequeues a Packet from the head of the queue
`void` | `enqueue(Packet packet)` Place a Packet at the head of the Queue
`void` | `enqueueNoBlock(Packet packet)` Enqueue a Packet without checking usage limits
`java.util.List` | `getContents()` Retrieve a shallow copy of the contents as a list
`java.lang.String` | `getName()`
`boolean` | `isEmpty()`
`boolean` | `isFull()`
`boolean` | `isStarted()`
`int` | `size()`
`void` | `start()` enable dequeueing
`void` | `stop()` disable dequeueing

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SpooledBoundedPacketQueue

    public SpooledBoundedPacketQueue(java.io.File dir,
                                     java.lang.String name,
                                     long maxDataLength,
                                     int maxBlockSize)
                              throws java.io.IOException

  Constructor for SpooledBoundedPacketQueue

Parameters:
  `dir` -
  `name` -
  `maxDataLength` -
  `maxBlockSize` -
Throws:
  `java.io.IOException`

### SpooledBoundedPacketQueue

    public SpooledBoundedPacketQueue(java.io.File dir,
                                     java.lang.String name)
                              throws java.io.IOException

  Constructor for SpooledBoundedPacketQueue

Parameters:
  `dir` -
  `name` -
Throws:
  `java.io.IOException`

Method Detail

### enqueue

    public void enqueue(Packet packet)
                 throws JMSException

  Place a Packet at the head of the Queue

  Specified by:
    `enqueue` in interface `BoundedPacketQueue`
  Parameters:
    `packet` -
  Throws:
    `JMSException`

### enqueueNoBlock

    public void enqueueNoBlock(Packet packet)
                        throws JMSException

  Enqueue a Packet without checking usage limits

  Specified by:
    `enqueueNoBlock` in interface `BoundedPacketQueue`
  Parameters:
    `packet` -
  Throws:
    `JMSException`

### dequeue

    public Packet dequeue()
                   throws JMSException,
                          java.lang.InterruptedException

  Specified by:
    `dequeue` in interface `BoundedPacketQueue`
  Returns:
    the first dequeued Packet or blocks until one is available
  Throws:
    `JMSException`
    `java.lang.InterruptedException`

### dequeue

    public Packet dequeue(long timeInMillis)
                   throws JMSException,
                          java.lang.InterruptedException

  Description copied from interface: `BoundedPacketQueue`
  Dequeues a Packet from the head of the queue

  Specified by:
    `dequeue` in interface `BoundedPacketQueue`
  Parameters:
    `timeInMillis` - maximum time to wait to dequeue a Packet
  Returns:
    the Packet from the head of the Queue or null if the Queue is empty
  Throws:
    `JMSException`
    `java.lang.InterruptedException`

### dequeueNoWait

    public Packet dequeueNoWait()
                         throws JMSException,
                                java.lang.InterruptedException

  Description copied from interface: `BoundedPacketQueue`
  dequeues a Packet from the head of the queue

  Specified by:
    `dequeueNoWait` in interface `BoundedPacketQueue`
  Returns:
    the Packet from the head of the Queue or null if the Queue is empty
  Throws:
    `JMSException`
    `java.lang.InterruptedException`

### isFull

    public boolean isFull()

  Returns:
    true if this queue has reached it's data length limit

### close

    public void close()

  close this queue

  Specified by:
    `close` in interface `BoundedPacketQueue`

### getName

    public java.lang.String getName()

  Specified by:
    `getName` in interface `BoundedPacketQueue`
  Returns:
    the name of this BoundedPacketQueue

### size

    public int size()

  Specified by:
    `size` in interface `BoundedPacketQueue`
  Returns:
    number of Packets held by this queue

### isStarted

    public boolean isStarted()

  Specified by:
    `isStarted` in interface `BoundedPacketQueue`
  Returns:
    true if the queue is enabled for dequeing (default = true)

### stop

    public void stop()

  disable dequeueing

  Specified by:
    `stop` in interface `BoundedPacketQueue`

### start

    public void start()

  enable dequeueing

  Specified by:
    `start` in interface `BoundedPacketQueue`

### isEmpty

    public boolean isEmpty()

  Specified by:
    `isEmpty` in interface `BoundedPacketQueue`
  Returns:
    true if this queue is empty

### clear

    public void clear()

  clear the queue

  Specified by:
    `clear` in interface `BoundedPacketQueue`

### getContents

    public java.util.List getContents()

  Description copied from interface: `BoundedPacketQueue`
  Retrieve a shallow copy of the contents as a list

  Specified by:
    `getContents` in interface `BoundedPacketQueue`
  Returns:
    a copy of the contents

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.