JDeveloper SCM API

oracle.ide.scm.util.runner
Class SCMBufferedStreamMonitor

java.lang.Object
  |
  +--oracle.ide.scm.util.runner.SCMBufferedStreamMonitor
All Implemented Interfaces:
SCMStreamMonitor
Direct Known Subclasses:
SCMPatternStreamMonitor

public class SCMBufferedStreamMonitor
extends java.lang.Object
implements SCMStreamMonitor

Buffered implementation of a stream monitor. Stores all data read from the stream and makes buffer contents accessible at any time, while the process is alive or after it has finished, as a string.


Field Summary
protected  java.lang.StringBuffer m_buffer
           
 
Constructor Summary
SCMBufferedStreamMonitor()
          Constructs a new buffered stream monitor with a new buffer.
SCMBufferedStreamMonitor(java.lang.StringBuffer buffer)
          Constructs a buffered stream monitor with an existing buffer.
 
Method Summary
protected  void clearBuffer()
          Clears the monitor's stream buffer.
 java.lang.String getBufferText()
          Obtains the contents of the buffer as a string.
 void streamBytes(byte[] bytes, int length, SCMProcess process)
          Adds all new data to the buffer of the monitor.
 void streamFinished(SCMProcess process)
          Performs no actions as finalization is not required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_buffer

protected final java.lang.StringBuffer m_buffer
Constructor Detail

SCMBufferedStreamMonitor

public SCMBufferedStreamMonitor()
Constructs a new buffered stream monitor with a new buffer.

SCMBufferedStreamMonitor

public SCMBufferedStreamMonitor(java.lang.StringBuffer buffer)
Constructs a buffered stream monitor with an existing buffer.
Parameters:
buffer - the monitor's stream buffer.
Method Detail

streamBytes

public void streamBytes(byte[] bytes,
                        int length,
                        SCMProcess process)
                 throws SCMStreamMonitorException
Adds all new data to the buffer of the monitor.
Specified by:
streamBytes in interface SCMStreamMonitor
Following copied from interface: oracle.ide.scm.util.runner.SCMStreamMonitor
Parameters:
bytes - the array containing recently read data, from index 0.
length - the length, in bytes, of the data that has been read.
process - the parent process for the stream.
Throws:
SCMStreamMonitorException - if the monitor raised an exception, and the stream should be closed.

streamFinished

public void streamFinished(SCMProcess process)
Performs no actions as finalization is not required.
Specified by:
streamFinished in interface SCMStreamMonitor
Following copied from interface: oracle.ide.scm.util.runner.SCMStreamMonitor
Parameters:
process - the parent process for the stream.

getBufferText

public java.lang.String getBufferText()
Obtains the contents of the buffer as a string.
Returns:
the current contents of the monitor's stream buffer.

clearBuffer

protected void clearBuffer()
Clears the monitor's stream buffer.

Copyright © 2002 Oracle Corporation