de.mud.jta.plugin
public class Sink extends Plugin implements FilterPlugin, java.lang.Runnable
Maintainer: Matthias L. Jugel
Modifier and Type | Field and Description |
---|---|
protected FilterPlugin |
source |
Constructor and Description |
---|
Sink(PluginBus bus,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected FilterPlugin source
public Sink(PluginBus bus, java.lang.String id)
public void run()
run
in interface java.lang.Runnable
public void setFilterSource(FilterPlugin source)
FilterPlugin
setFilterSource
in interface FilterPlugin
source
- the data sourcepublic FilterPlugin getFilterSource()
getFilterSource
in interface FilterPlugin
public int read(byte[] b) throws java.io.IOException
FilterPlugin
read
in interface FilterPlugin
b
- the buffer to read the data intojava.io.IOException
public void write(byte[] b) throws java.io.IOException
FilterPlugin
write
in interface FilterPlugin
b
- the buffer to be sentjava.io.IOException