JDeveloper SCM API

oracle.ide.scm.util.runner
Class SCMLineStreamMonitor

java.lang.Object
  |
  +--oracle.ide.scm.util.runner.SCMLineStreamMonitor
All Implemented Interfaces:
SCMStreamMonitor

public abstract class SCMLineStreamMonitor
extends java.lang.Object
implements SCMStreamMonitor

Line-based implementation of a stream monitor. An abstraction intended for subclass updates when new lines of data (as determined by platform-dependent newline character sequences) have become available.


Constructor Summary
SCMLineStreamMonitor()
          Constructs a new line stream monitor.
 
Method Summary
 void streamBytes(byte[] bytes, int length, SCMProcess process)
          Updates an underlying buffer and sends line update notifications.
 void streamFinished(SCMProcess process)
          Clears the last line of data from the buffer.
protected abstract  void streamLine(java.lang.String line, SCMProcess process)
          Notifies the monitor subclass that a new line has been read from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCMLineStreamMonitor

public SCMLineStreamMonitor()
Constructs a new line stream monitor.
Method Detail

streamBytes

public final void streamBytes(byte[] bytes,
                              int length,
                              SCMProcess process)
                       throws SCMStreamMonitorException
Updates an underlying buffer and sends line update notifications.
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)
Clears the last line of data from the buffer. A final update notification is sent if the buffer contained data.
Specified by:
streamFinished in interface SCMStreamMonitor
Following copied from interface: oracle.ide.scm.util.runner.SCMStreamMonitor
Parameters:
process - the parent process for the stream.

streamLine

protected abstract void streamLine(java.lang.String line,
                                   SCMProcess process)
                            throws SCMStreamMonitorException
Notifies the monitor subclass that a new line has been read from the stream. The line will not contain newline characters or require trimming.
Parameters:
line - the string which has recently been read.
process - the parent process for the stream.
Throws:
SCMStreamMonitorException - if the monitor raised an exception, and the stream should be closed.

Copyright © 2002 Oracle Corporation