org.ow2.jonas.lib.jmbeans.log
Class RecordFeeder

java.lang.Object
  extended by org.ow2.jonas.lib.jmbeans.log.RecordFeeder
All Implemented Interfaces:
Runnable

public class RecordFeeder
extends Object
implements Runnable

Author:
waeselyf

Constructor Summary
RecordFeeder(LinkedList queue, TreeSet recordSet)
          Construct the LogBuffer's recordSet feeder.
 
Method Summary
 int getMaxRecFetch()
           
 int getMaxRecords()
           
 LogRecord[] readRecords()
          Read from the source queue Waits for a while if necessary A post is assumed to notify the thread.
 void run()
           
 void setMaxRecFetch(int max)
           
 void setMaxRecords(int max)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordFeeder

public RecordFeeder(LinkedList queue,
                    TreeSet recordSet)
Construct the LogBuffer's recordSet feeder. The feeder extracts maxRecFerch records from the LogRecords source and adds them to the records TreeSet.

Parameters:
queue - source of LogRecords
recordSet - LogRecords TreeSet to update
Method Detail

run

public void run()
Specified by:
run in interface Runnable

readRecords

public LogRecord[] readRecords()
Read from the source queue Waits for a while if necessary A post is assumed to notify the thread.

Returns:
an array of records containing maximum maxRecFetch LogRecord extracted from the source queue, or null if the thread is interrupted

setMaxRecords

public void setMaxRecords(int max)

getMaxRecords

public int getMaxRecords()

setMaxRecFetch

public void setMaxRecFetch(int max)

getMaxRecFetch

public int getMaxRecFetch()


Copyright © 2010 OW2 Consortium. All Rights Reserved.