de.mud.jta.plugin
Class Sink
java.lang.Object
de.mud.jta.Plugin
de.mud.jta.plugin.Sink
- All Implemented Interfaces:
- FilterPlugin, java.lang.Runnable
public class Sink
- extends Plugin
- implements FilterPlugin, java.lang.Runnable
The terminal plugin represents the actual terminal where the
data will be displayed and the gets the keyboard input to sent
back to the remote host.
Maintainer: Matthias L. Jugel
- Version:
- $Id: Sink.java 499 2005-09-29 08:24:54Z leo $
- Author:
- Matthias L. Jugel, Marcus Mei???ner
Method Summary |
FilterPlugin |
getFilterSource()
|
int |
read(byte[] b)
Read a block of data from the back end. |
void |
run()
Continuously read from our back end and drop the data. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
protected FilterPlugin source
Sink
public Sink(PluginBus bus,
java.lang.String id)
run
public void run()
- Continuously read from our back end and drop the data.
- Specified by:
run
in interface java.lang.Runnable
setFilterSource
public void setFilterSource(FilterPlugin source)
- Description copied from interface:
FilterPlugin
- 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.
- Specified by:
setFilterSource
in interface FilterPlugin
- Parameters:
source
- the data source
getFilterSource
public FilterPlugin getFilterSource()
- Specified by:
getFilterSource
in interface FilterPlugin
read
public int read(byte[] b)
throws java.io.IOException
- Description copied from interface:
FilterPlugin
- Read a block of data from the back end.
- Specified by:
read
in interface FilterPlugin
- Parameters:
b
- the buffer to read the data into
- Returns:
- the amount of bytes actually read
- Throws:
java.io.IOException
write
public void write(byte[] b)
throws java.io.IOException
- Description copied from interface:
FilterPlugin
- Write a block of data to the back end.
- Specified by:
write
in interface FilterPlugin
- Parameters:
b
- the buffer to be sent
- Throws:
java.io.IOException