com.bigdata.counters
Class ProcessReaderHelper

java.lang.Object
  extended by com.bigdata.counters.AbstractProcessReader
      extended by com.bigdata.counters.ProcessReaderHelper
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
PIDStatCollector.PIDStatReader

public abstract class ProcessReaderHelper
extends AbstractProcessReader


Field Summary
protected  LineNumberReader r
          The Reader from which the output of the process will be read.
 
Fields inherited from class com.bigdata.counters.AbstractProcessReader
is, log
 
Constructor Summary
ProcessReaderHelper()
           
 
Method Summary
protected abstract  ActiveProcess getActiveProcess()
          Override to return the ActiveProcess.
 String readLine()
          Returns the next line and blocks if a line is not available.
protected abstract  void readProcess()
          Responsible for reading the data.
 void run()
           
 void start(InputStream is)
          Creates a LineNumberReader from the InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

r

protected LineNumberReader r
The Reader from which the output of the process will be read.

Constructor Detail

ProcessReaderHelper

public ProcessReaderHelper()
Method Detail

start

public void start(InputStream is)
Creates a LineNumberReader from the InputStream.

Overrides:
start in class AbstractProcessReader
Parameters:
is - The input stream from which the output of the process will be read.

getActiveProcess

protected abstract ActiveProcess getActiveProcess()
Override to return the ActiveProcess.


readLine

public String readLine()
                throws IOException,
                       InterruptedException
Returns the next line and blocks if a line is not available.

Returns:
The next line.
Throws:
InterruptedException
IOException - if the source is closed.
InterruptedException - if the thread has been interrupted (this is normal during shutdown).

run

public void run()

readProcess

protected abstract void readProcess()
                             throws Exception
Responsible for reading the data.

Throws:
Exception


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.