Interface IQueue

All Known Implementing Classes:
ChroniclePersistentQueue, InMemoryQueue, PersistentFileQueue, PersistentInMemoryQueue

public interface IQueue
IQueue interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] itemBody)
    add message to queue.
    void
    add(byte[] itemBody, String jmsMessageParams)
    add message to queue.
    void
    Clears the queue.
    void
    Removes polled object from the queue.
    void
    commit(IQueueable[] batchItems, int size)
    Removes polled objects from the queue.
    void
    Return element to queue.
    void
    failedProcessing(IQueueable[] batchItems, int size)
    Return element to queue.
    void
    Initializes queue.
    boolean
    Checks if queue is currently empty.
    Poll object from the queue (doesn't remove it from queue yet!).
    void
    Gracefully shutdowns queue.
    int
    Returns current queue size.
    Retrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available.
    int
    take(IQueueable[] batch)
    Retrieves and mark as processing the batch elements from head of this queue, waiting if necessary until at least one element becomes available.
  • Method Details

    • add

      void add(byte[] itemBody) throws InterruptedException, IOException
      add message to queue.
      Parameters:
      itemBody -
      Throws:
      InterruptedException
      IOException
    • add

      void add(byte[] itemBody, String jmsMessageParams) throws InterruptedException, IOException
      add message to queue.
      Parameters:
      itemBody -
      Throws:
      InterruptedException
      IOException
    • poll

      IQueueable poll()
      Poll object from the queue (doesn't remove it from queue yet!). Change tem state to processing.
      Returns:
      the head of this queue, or null if this queue is empty
      See Also:
    • take

      IQueueable take()
      Retrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available.
      Returns:
      the head of this queue
      Throws:
      IllegalStateException - if interrupted while waiting
    • take

      int take(IQueueable[] batch)
      Retrieves and mark as processing the batch elements from head of this queue, waiting if necessary until at least one element becomes available.
      Returns:
      the number of read elements
      Throws:
      IllegalStateException - if interrupted while waiting
    • failedProcessing

      void failedProcessing(IQueueable items)
      Return element to queue. Item will be available again for handing.
      Parameters:
      items -
    • failedProcessing

      void failedProcessing(IQueueable[] batchItems, int size)
      Return element to queue. Items will be available again for handing.
      Parameters:
      batchItems -
      size - the number of items in batch
    • commit

      void commit(IQueueable object) throws IOException
      Removes polled object from the queue.
      Parameters:
      object -
      Throws:
      IOException
    • commit

      void commit(IQueueable[] batchItems, int size) throws IOException
      Removes polled objects from the queue.
      Parameters:
      batchItems -
      size - the number of items in batch
      Throws:
      IOException
    • isEmpty

      boolean isEmpty()
      Checks if queue is currently empty.
      Returns:
      true if empty
    • size

      int size()
      Returns current queue size.
      Returns:
      queue size
    • clear

      void clear() throws IOException
      Clears the queue.
      Throws:
      IOException
    • shutdown

      void shutdown()
      Gracefully shutdowns queue.
    • initialize

      void initialize() throws IOException
      Initializes queue. That includes restore of previously saved queue content for persistent queues.
      Throws:
      IOException