org.jppf.server.queue
Interface JPPFQueue

All Superinterfaces:
Iterable<BundleWrapper>
All Known Implementing Classes:
AbstractJPPFQueue, JPPFPriorityQueue

public interface JPPFQueue
extends Iterable<BundleWrapper>

Implementation of a generic non-blocking queue, to allow asynchronous access from a large number of threads.

Author:
Laurent Cohen

Method Summary
 void addBundle(BundleWrapper bundleWrapper)
          Add an object to the queue, and notify all listeners about it.
 int getMaxBundleSize()
          Get the maximum bundle size for the bundles present in the queue.
 boolean isEmpty()
          Determine whether the queue is empty or not.
 BundleWrapper nextBundle(BundleWrapper bundleWrapper, int nbTasks)
          Get the next object in the queue.
 BundleWrapper nextBundle(int nbTasks)
          Get the next object in the queue.
 BundleWrapper removeBundle(BundleWrapper bundleWrapper)
          Remove the specified bundle from the queue.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addBundle

void addBundle(BundleWrapper bundleWrapper)
Add an object to the queue, and notify all listeners about it.

Parameters:
bundleWrapper - the object to add to the queue.

nextBundle

BundleWrapper nextBundle(int nbTasks)
Get the next object in the queue.

Parameters:
nbTasks - the maximum number of tasks to get out of the bundle.
Returns:
the most recent object that was added to the queue.

nextBundle

BundleWrapper nextBundle(BundleWrapper bundleWrapper,
                         int nbTasks)
Get the next object in the queue.

Parameters:
bundleWrapper - the bundle to either remove or extract a sub-bundle from.
nbTasks - the maximum number of tasks to get out of the bundle.
Returns:
the most recent object that was added to the queue.

isEmpty

boolean isEmpty()
Determine whether the queue is empty or not.

Returns:
true if the queue is empty, false otherwise.

getMaxBundleSize

int getMaxBundleSize()
Get the maximum bundle size for the bundles present in the queue.

Returns:
the bundle size as an int.

removeBundle

BundleWrapper removeBundle(BundleWrapper bundleWrapper)
Remove the specified bundle from the queue.

Parameters:
bundleWrapper - the bundle to remove.
Returns:
the bundle that was removed.


Copyright © 2005-2010 JPPF Team.