com.deltax.util.listener
Class SimpleListener

java.lang.Object
  extended bycom.deltax.util.listener.SimpleListener
All Implemented Interfaces:
Listener
Direct Known Subclasses:
BridgeListener

public class SimpleListener
extends java.lang.Object
implements Listener

A listener which simply outputs signals on a given stream or writer.

Version:
1.0
Author:
Cristiano Sadun

Constructor Summary
SimpleListener()
          Create a listener which outputs to System.out
SimpleListener(java.io.OutputStream outputstream)
          Create a listener which outputs to the given stream
SimpleListener(java.io.Writer writer)
          Create a listener which outputs to the given writer
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushes the stream.
 boolean isAutoFlushing()
          Return the autoFlushing mode
 void receive(Signal signal)
          This implementation discriminates among NamedSignals, MsgSignals and ExceptionSignals.
 void setAutoFlushing(boolean autoFlushing)
          Set the autoFlushing mode (defaults to true)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleListener

public SimpleListener()
Create a listener which outputs to System.out


SimpleListener

public SimpleListener(java.io.OutputStream outputstream)
Create a listener which outputs to the given stream

Parameters:
outputstream - the stream to output to

SimpleListener

public SimpleListener(java.io.Writer writer)
Create a listener which outputs to the given writer

Parameters:
writer - the writer to output to
Method Detail

receive

public void receive(Signal signal)
This implementation discriminates among NamedSignals, MsgSignals and ExceptionSignals.

Specified by:
receive in interface Listener
Parameters:
signal - the received signal

flush

public void flush()
Flushes the stream.


close

public void close()
Closes the stream.


isAutoFlushing

public boolean isAutoFlushing()
Return the autoFlushing mode

Returns:
Return the autoFlushing mode

setAutoFlushing

public void setAutoFlushing(boolean autoFlushing)
Set the autoFlushing mode (defaults to true)

Parameters:
autoFlushing - the autoFlushing mode