com.rhi.architecture.parc
Class ArrayListQueue

java.lang.Object
  extended bycom.rhi.architecture.parc.channel.AbstractChannel
      extended bycom.rhi.architecture.parc.ArrayListQueue
All Implemented Interfaces:
Channel, java.lang.Cloneable, Consumer, Supplier

public class ArrayListQueue
extends AbstractChannel

Channel Implementation using ArrayList.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
ArrayListQueue()
          Default constructor.
 
Method Summary
 java.lang.Object clone()
          Simple Object based clone() method.
 java.util.Collection pull(int max)
          Pull a set of records out of the channel for processing.
 void push(java.util.Collection collection)
          Push an entire collection into the channel.
 
Methods inherited from class com.rhi.architecture.parc.channel.AbstractChannel
log, notifyMonitors, registerMonitor
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayListQueue

public ArrayListQueue()
Default constructor.

Since:
1.0
Method Detail

push

public void push(java.util.Collection collection)
          throws ProcessingException
Push an entire collection into the channel. Useful for batch of an entire set of records.

Parameters:
collection - of records to enqueue.
Throws:
ProcessingException
Since:
1.0

pull

public java.util.Collection pull(int max)
                          throws ProcessingException
Pull a set of records out of the channel for processing.

Parameters:
max - - maximum number of records to pull from the channel.
Returns:
Collection of records returned from channel.
Throws:
ProcessingException
Since:
1.0

clone

public java.lang.Object clone()
Simple Object based clone() method. The reason this is okay is because i'm counting on re-using the same channel between each filter. That's where the concurrency comes in & why i'm using Doug Lea's package in the first place. In this case, simple is good.

Specified by:
clone in interface Channel
Overrides:
clone in class AbstractChannel
Returns:
Queue object
Since:
1.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.