org.ourgrid.common.executor
Class OutputCatcher

java.lang.Object
  extended by org.ourgrid.common.executor.OutputCatcher
All Implemented Interfaces:
java.lang.Runnable

public class OutputCatcher
extends java.lang.Object
implements java.lang.Runnable

This class creates a thread to read inputStream


Constructor Summary
OutputCatcher(java.io.InputStream isr)
          Constructs the OutputCatcher object based on a stream to consume.
 
Method Summary
 java.lang.String getResult()
          This method provides access to the information read from stream.
 void run()
          The main method for the OutputCatcher thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputCatcher

public OutputCatcher(java.io.InputStream isr)
Constructs the OutputCatcher object based on a stream to consume.

Parameters:
isr - The stream will be consumed by the thread.
Method Detail

run

public void run()
The main method for the OutputCatcher thread. The idea is to consume the data generated by the stream and close it in the end.

Specified by:
run in interface java.lang.Runnable

getResult

public java.lang.String getResult()
                           throws java.lang.InterruptedException
This method provides access to the information read from stream.

Returns:
What has been read.
Throws:
java.lang.InterruptedException - If the thread has been interrupted