|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ow2.jasmine.monitoring.mbeancmd.Iner
A pipe consists of a pair of channels: a writable channel (called "sink", where information is written to) and a readable channel (called "source", where information is obtained from). The general idea is that once some bytes are available on the source: 1. The pipe reads those bytes. 2. If required, does some action with some or all of these bytes (for example, write them to a file). 3. If a sink is present, writes the exact same bytes in the exact same order on the sink. An Iner instance can retrieve information from (=use as source) an InputStream or a File.
Field Summary | |
private java.io.PipedOutputStream |
sink
Sink. |
private java.io.LineNumberReader |
source
Lines input line per line. |
private java.io.PrintWriter |
wsink
Writer that writes on the sink. |
Constructor Summary | |
Iner(java.io.File file)
Creates an Iner using a File as source. |
|
Iner(java.io.InputStream in)
Creates an Iner using an InputStream as source. |
Method Summary | |
java.io.PipedOutputStream |
getSink()
|
void |
run()
Starts the activity on the Iner (as described in the class header). |
void |
setSink(java.io.PipedOutputStream sink)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.LineNumberReader source
private java.io.PipedOutputStream sink
private java.io.PrintWriter wsink
Constructor Detail |
public Iner(java.io.InputStream in)
in
- InputStream to use as source.setSink(PipedOutputStream)
public Iner(java.io.File file) throws java.io.FileNotFoundException
file
- File to use as source.
java.io.FileNotFoundException
- If file not found.setSink(PipedOutputStream)
Method Detail |
public void setSink(java.io.PipedOutputStream sink)
sink
- Sink to set. A dummy sink will be created if null.public java.io.PipedOutputStream getSink()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |