|
||||||||||
| 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(PipedOutputStream src)
|
|
Outer(PipedOutputStream src,
File file)
Creates an Outer using a PipedOutputStream as source and a File as output. |
|
Outer(PipedOutputStream src,
PrintStream target)
Creates an Outer using a PipedOutputStream as source and a PrintStream as output. |
|
| Method Summary | |
|---|---|
String |
getId()
|
static String |
getSeparator()
|
PipedOutputStream |
getSink()
|
static void |
main(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(String[] columns)
|
void |
setId(String id)
|
void |
setRegexp(String exp)
|
static void |
setSeparator(String s)
|
void |
setSink(PipedOutputStream sink)
|
void |
setTimeFilter(String field,
String fieldFormat,
String from,
String to)
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Outer(PipedOutputStream src,
PrintStream target)
throws 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).
IOException - If construction or pipe connection fails.setSink(PipedOutputStream)
public Outer(PipedOutputStream src)
throws IOException
IOException
public Outer(PipedOutputStream src,
File file)
throws 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.
IOException - If construction or pipe connection fails.setSink(PipedOutputStream)| Method Detail |
|---|
public void setSink(PipedOutputStream sink)
sink - Sink to set. A dummy sink will be created if null.public PipedOutputStream getSink()
public String getId()
public void setId(String id)
id - The id to set.
public static void main(String[] args)
throws IOException
args - Ignored.
IOException - When there's a problem with the source or sink.public void run()
run in interface Runnablepublic void stop()
public void setFormatter(String[] columns)
columns - Name of the columns to set in the formatter.public void setRegexp(String exp)
exp - Regular expression to use as filter for the target.
public void setTimeFilter(String field,
String fieldFormat,
String from,
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 String getSeparator()
public static void setSeparator(String s)
s - New field separator to use.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||