org.apache.felix.eventadmin.impl.dispatch
Interface TaskQueue

All Known Implementing Classes:
TaskHandler

public interface TaskQueue

This is the interface for a simple queue that allows to append or push arrays of tasks to it. The elements of such an array are added atomically (i.e, they are in the same order one after the other in the queue) either at the end or the front of the queue. Additionally, the queue can be closed.

Author:
Felix Project Team

Method Summary
 void append(HandlerTask[] tasks)
          Append the tasks to this queue in one atomic operation while preserving their order.
 void close(HandlerTask shutdownTask)
          Close the queue.
 void push(HandlerTask[] tasks)
          Push the tasks to this queue in one atomic operation while preserving their order.
 

Method Detail

append

void append(HandlerTask[] tasks)
Append the tasks to this queue in one atomic operation while preserving their order.

Parameters:
tasks - The tasks to append to this queue
Throws:
IllegalStateException - in case that this queue is already closed

push

void push(HandlerTask[] tasks)
Push the tasks to this queue in one atomic operation while preserving their order.

Parameters:
tasks - The tasks to push to the front of this queue.
Throws:
IllegalStateException - in case that this queue is already closed

close

void close(HandlerTask shutdownTask)
Close the queue. The given callback will be executed once the queue is empty.

Parameters:
shutdownTask - The task to execute once the queue is empty


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.