de.mud.jta
Interface FilterPlugin

All Known Implementing Classes:
BSX, Timeout, SSH, ButtonBar, Terminal, Script, EInput01, Shell, Capture, Telnet, Socket, MUDColorizer, Sink, URLFilter

public interface FilterPlugin

The filter plugin is the base interface for plugins that want to intercept the communication between front end and back end plugins. Filters and protocol handlers are a good example.

Maintainer: Matthias L. Jugel

Version:
$Id: FilterPlugin.java,v 2.0 1999/09/08 17:01:45 leo Exp $
Author:
Matthias L. Jugel, Marcus Meißner

Method Summary
 int read(byte[] b)
          Read a block of data from the back end.
 void setFilterSource(FilterPlugin source)
          Set the source plugin where we get our data from and where the data sink (write) is.
 void write(byte[] b)
          Write a block of data to the back end.
 

Method Detail

setFilterSource

public void setFilterSource(FilterPlugin source)
                     throws java.lang.IllegalArgumentException
Set the source plugin where we get our data from and where the data sink (write) is. The actual data handling should be done in the read() and write() methods.
Parameters:
source - the data source

read

public int read(byte[] b)
         throws java.io.IOException
Read a block of data from the back end.
Parameters:
b - the buffer to read the data into
Returns:
the amount of bytes actually read

write

public void write(byte[] b)
           throws java.io.IOException
Write a block of data to the back end.
Parameters:
b - the buffer to be sent