ptolemy.kernel.util
Class StreamChangeListener

java.lang.Object
  extended by ptolemy.kernel.util.StreamChangeListener
All Implemented Interfaces:
ChangeListener

public class StreamChangeListener
extends java.lang.Object
implements ChangeListener

A change listener that describes the changes on the standard output. It simply prints the description of the change once it executes (or throws an exception).

Since:
Ptolemy II 1.0
Version:
$Id: StreamChangeListener.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
Accepted Rating:
Green (neuendor)
Proposed Rating:
Green (eal)

Field Summary
protected  java.io.PrintStream _output
          The PrintStream that we direct the output to.
 
Constructor Summary
StreamChangeListener()
          Create a change listener that sends messages to the standard output.
StreamChangeListener(java.io.OutputStream out)
          Create a change listener that sends messages to the specified stream.
 
Method Summary
 void changeExecuted(ChangeRequest change)
          Print the description of the change to the stream output.
 void changeFailed(ChangeRequest change, java.lang.Exception exception)
          Print the description of the failure to the stream output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_output

protected java.io.PrintStream _output
The PrintStream that we direct the output to.

Constructor Detail

StreamChangeListener

public StreamChangeListener()
Create a change listener that sends messages to the standard output.


StreamChangeListener

public StreamChangeListener(java.io.OutputStream out)
Create a change listener that sends messages to the specified stream.

Parameters:
out - The stream to send messages to.
Method Detail

changeExecuted

public void changeExecuted(ChangeRequest change)
Print the description of the change to the stream output.

Specified by:
changeExecuted in interface ChangeListener
Parameters:
change - The change that has been executed.

changeFailed

public void changeFailed(ChangeRequest change,
                         java.lang.Exception exception)
Print the description of the failure to the stream output.

Specified by:
changeFailed in interface ChangeListener
Parameters:
change - The change that has been executed.
exception - The exception that occurred.