org.opennms.core.queue
Interface ClosableFifoQueue<T>

All Superinterfaces:
FifoQueue<T>

public interface ClosableFifoQueue<T>
extends FifoQueue<T>

This interface defines a FIFO queue that can be open and closed to control the addition of elements to the queue. When the queue is opened it is possible to add new elements to the queue. When the queue is closed, it is should not be possible to add elements to the queue. It should always be possible to read elements from the queue, so long as it is not empty.

Version:
$Id: $
Author:
Brian Weaver , OpenNMS , Brian Weaver , OpenNMS

Method Summary
 void close()
          Closes a currently open queue.
 boolean isClosed()
          Returns true if the queue is currently closed.
 boolean isOpen()
          Returns true if the queue is currently open.
 void open()
          Ensures that the queue is open and new elements can be added to the queue.
 
Methods inherited from interface org.opennms.core.queue.FifoQueue
add, add, isEmpty, remove, remove, size
 

Method Detail

isOpen

boolean isOpen()
Returns true if the queue is currently open.

Type Parameters:
T - a T object.
Returns:
True if the queue is open.

isClosed

boolean isClosed()
Returns true if the queue is currently closed.

Returns:
True if the queue is closed.

close

void close()
           throws FifoQueueException
Closes a currently open queue. When a queue is closed is should still allow elements already in the queue to be removed, but new elements should not be added.

Throws:
FifoQueueException - Thrown if an error occurs closing the queue.
FifoQueueException - if any.

open

void open()
          throws FifoQueueException
Ensures that the queue is open and new elements can be added to the queue.

Throws:
FifoQueueException - Thrown if an error occurs opening the queue.
FifoQueueException - if any.


Copyright © 2011. All Rights Reserved.