org.ijsberg.iglu.util.io
Class StdIODialog

java.lang.Object
  extended by org.ijsberg.iglu.util.io.StdIODialog
All Implemented Interfaces:
Runnable, Receiver

public class StdIODialog
extends Object
implements Receiver, Runnable

Takes a configured In- and OutputStream such as System.in and System.out which are used as standard in- and output for an underlying process such as a command shell.


Constructor Summary
StdIODialog(InputStream in, OutputStream out, Transceiver transceiver)
          Constructs dialog for an object transceiver.
 
Method Summary
 void close()
          Closes dialog and (transceiver) process.
 void onReceive(Object o)
          Writes received object to an output stream.
 void onTransmissionClose()
          Enters closed state.
 void open()
          Starts communicating.
 void openAsync()
          Starts communicating in a separate thread.
 void run()
          Starts communicating.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdIODialog

public StdIODialog(InputStream in,
                   OutputStream out,
                   Transceiver transceiver)
Constructs dialog for an object transceiver.

Parameters:
in -
out -
transceiver -
Method Detail

openAsync

public void openAsync()
               throws IOException
Starts communicating in a separate thread.

Throws:
IOException

open

public void open()
          throws IOException
Starts communicating. This method blocks until the dialog or the underlying (transceiver) process is closed.

Throws:
IOException

close

public void close()
Closes dialog and (transceiver) process.


run

public void run()
Starts communicating. This method blocks until the dialog or the underlying (transceiver) process is closed.

Specified by:
run in interface Runnable

onReceive

public void onReceive(Object o)
Writes received object to an output stream.

Specified by:
onReceive in interface Receiver
Parameters:
o -

onTransmissionClose

public void onTransmissionClose()
Enters closed state.

Specified by:
onTransmissionClose in interface Receiver


Copyright © 2011. All Rights Reserved.