|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jasmine.monitoring.mbeancmd.Outer
public class Outer
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 Outer instance can retrieve information from (=use as source) a PrintStream or a File and outputs information to (=uses as sink) a PipedOutputStream. The main difference between an Outer and an Iner is that an Outer can also filter out (@see Outer.setRegexp and Outer.setTimeFilter) information and output it on a target. Note that the sink still keeps on receiving unmodified data from the source.
| Constructor Summary | |
|---|---|
Outer(java.io.PipedOutputStream src,
java.io.File file)
Creates an Outer using a PipedOutputStream as source and a File as output. |
|
Outer(java.io.PipedOutputStream src,
java.io.PrintStream target)
Creates an Outer using a PipedOutputStream as source and a PrintStream as output. |
|
| Method Summary | |
|---|---|
java.lang.String |
getId()
|
static java.lang.String |
getSeparator()
|
java.io.PipedOutputStream |
getSink()
|
static void |
main(java.lang.String[] args)
Tests the Outer implementation. |
void |
resetTimeFilter()
Resets the time filter. |
void |
run()
Starts the activity on the Outer (as described in the class header). |
void |
setFormatter(java.lang.String[] columns)
|
void |
setId(java.lang.String id)
|
void |
setRegexp(java.lang.String exp)
|
static void |
setSeparator(java.lang.String s)
|
void |
setSink(java.io.PipedOutputStream sink)
|
void |
setTimeFilter(java.lang.String field,
java.lang.String fieldFormat,
java.lang.String from,
java.lang.String to)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Outer(java.io.PipedOutputStream src,
java.io.PrintStream target)
throws java.io.IOException
getSink() and that can
be used an input to any pipe) will be created by default.
src - PipedOutputStream to use as source.target - PrintStream to use as target (can be null).
java.io.IOException - If construction or pipe connection fails.setSink(PipedOutputStream)
public Outer(java.io.PipedOutputStream src,
java.io.File file)
throws java.io.IOException
getSink() and that can
be used an input to any pipe) will be created by default.
src - PipedOutputStream to use as source.file - File to use as output.
java.io.IOException - If construction or pipe connection fails.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 java.lang.String getId()
public void setId(java.lang.String id)
id - The id to set.
public static void main(java.lang.String[] args)
throws java.io.IOException
args - Ignored.
java.io.IOException - When there's a problem with the source or sink.public void run()
run in interface java.lang.Runnablepublic void setFormatter(java.lang.String[] columns)
columns - Name of the columns to set in the formatter.public void setRegexp(java.lang.String exp)
exp - Regular expression to use as filter for the target.
public void setTimeFilter(java.lang.String field,
java.lang.String fieldFormat,
java.lang.String from,
java.lang.String to)
field - Which field to use for time filtering.fieldFormat - Format of the time field as described in
SimpleDateFormat.from - Time from which to start outputting data.to - Time at which to stop outputting data.resetTimeFilter()public void resetTimeFilter()
setTimeFilter(String, String, String, String)public static java.lang.String getSeparator()
public static void setSeparator(java.lang.String s)
s - New field separator to use.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||