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

All Superinterfaces:
FifoQueue<T>

public interface NotifiableOutputFifoQueue<T>
extends FifoQueue<T>

This interface is implemented by FIFO queue implementations that can notify interested listener when elements are removed from the queue. This is useful for listeners that may block or preform other work while a queue is not empty, instead of using polling.

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

Method Summary
 void addOutputListener(OutputFifoQueueListener listener)
          Adds a new listener to the notifiable queue.
 void removeOutputListener(OutputFifoQueueListener listener)
          Removes an already registered listener.
 
Methods inherited from interface org.opennms.core.queue.FifoQueue
add, add, isEmpty, remove, remove, size
 

Method Detail

addOutputListener

void addOutputListener(OutputFifoQueueListener listener)
Adds a new listener to the notifiable queue. If the listener already exists then it is up to the implementor to determine behavior. When a new element is removed from the queue the listener will have its callbackmethod invoked.

Parameters:
listener - The instance to be notified on queue removals.

removeOutputListener

void removeOutputListener(OutputFifoQueueListener listener)
Removes an already registered listener. If the listener was not already registered then no action is performed.

Parameters:
listener - The listener to remove from the queue.


Copyright © 2011. All Rights Reserved.