org.gridbus.broker.farming.common
Interface JobOut

All Known Implementing Classes:
GlobusJobError, GlobusJobOutput

public interface JobOut

This interface is a wrapper around a StringBuffer. It takes care of getting output from remote node , retaining it and flushing it to storage in some form. One of the fundamental questions was whether the output needs to be retained or not. If the output of the jobs is to be retained then lots of jobs with lots of lines of output will cause the application to run out of memory. However, if the output were to be discarded after every call, then we run the risk of reconnecting every time to the remote site to receive output. However, connections fail and in interactive situations (such as Website), this could cause problems. But, some applications need to access the output only once and so, it need not be retained. Since, the application/user is the best judge of whether the output needs to be retained or not, this interface will help to do that. We will use an IF_RETAIN boolean flag while retrieving output which if true means the output will be retained and if false, the it will be discarded. A function is also provided to write the output back to disk/network/console and another to reset the StringBuffer.

Author:
Srikumar Venugopal (srikumar@cs.mu.oz.au)

Method Summary
 void flush(java.io.Writer out)
          Flushes (writes) output to specified destination.
 java.lang.StringBuffer get(boolean IF_RETAIN)
          This method gets the job output and retains it if needed.
 java.lang.StringBuffer getFiltered(boolean IF_RETAIN)
          Returns the filtered job output and retains if needed.
 void reset()
          Resets the job output
 

Method Detail

get

public java.lang.StringBuffer get(boolean IF_RETAIN)
                           throws java.lang.Exception
This method gets the job output and retains it if needed.

Parameters:
IF_RETAIN -
Returns:
StringBuffer
Throws:
java.lang.Exception

getFiltered

public java.lang.StringBuffer getFiltered(boolean IF_RETAIN)
                                   throws java.lang.Exception
Returns the filtered job output and retains if needed.

Parameters:
IF_RETAIN -
Returns:
String
Throws:
java.lang.Exception

reset

public void reset()
Resets the job output


flush

public void flush(java.io.Writer out)
           throws java.lang.Exception
Flushes (writes) output to specified destination.

Parameters:
out -
Throws:
java.lang.Exception