APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.jvm.hotspot.utilities

public Class StreamMonitor

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.io.*, java.util.*

Reads all of the data from the given InputStream, and allows the caller to wait for a given string to come in or watch for many possible strings.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private StringBuffer
private BufferedReader
private String
private boolean
private boolean
private List<StreamMonitor.Trigger>
private List<Integer>
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
StreamMonitor(InputStream istr)

Equivalent to StreamMonitor(istr, null, false)

public
StreamMonitor(InputStream istr, String prefixString, boolean printContents)

Method Summary

Modifier and TypeMethod and Description
public boolean
addTrigger(String str, int value)

Adds a "trigger", which the stream watches for and, if seen, reports the trigger value of via the getTriggers() method.

public boolean
addTrigger(String[] strs, int value)

Adds a "trigger", which the stream watches for and, if seen, reports the trigger value of via the getTriggers() method.

public synchronized List<Integer>
getTriggersSeen()

Returns an List of java.lang.Integer objects indicating the values of the triggers seen since the last call to getTriggersSeen.

public boolean
removeTrigger(String str)

Removes a previously added trigger.

public boolean
removeTrigger(String[] strs)

Removes a previously added trigger.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public synchronized void
public synchronized String
public synchronized boolean
waitFor(String str, long millis)

Waits for the specified string to come in for the given period of time (measured in milliseconds).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

captureBufferback to summary
private StringBuffer captureBuffer
inputback to summary
private BufferedReader input
prefixStringback to summary
private String prefixString
printContentsback to summary
private boolean printContents
printStreamContentsback to summary
private boolean printStreamContents
triggersback to summary
private List<StreamMonitor.Trigger> triggers
triggersSeenback to summary
private List<Integer> triggersSeen
waitStringback to summary
private String waitString
waitStringSeenback to summary
private boolean waitStringSeen

Constructor Detail

StreamMonitorback to summary
public StreamMonitor(InputStream istr)

Equivalent to StreamMonitor(istr, null, false)

StreamMonitorback to summary
public StreamMonitor(InputStream istr, String prefixString, boolean printContents)

Method Detail

addTriggerback to summary
public boolean addTrigger(String str, int value)

Adds a "trigger", which the stream watches for and, if seen, reports the trigger value of via the getTriggers() method. Returns true if the addition was successful, false if the string was already present as a trigger.

addTriggerback to summary
public boolean addTrigger(String[] strs, int value)

Adds a "trigger", which the stream watches for and, if seen, reports the trigger value of via the getTriggers() method. Returns true if the addition was successful, false if the string was already present as a trigger.

getTriggersSeenback to summary
public synchronized List<Integer> getTriggersSeen()

Returns an List of java.lang.Integer objects indicating the values of the triggers seen since the last call to getTriggersSeen. If there were no triggers seen, returns an empty list; does not return null.

removeTriggerback to summary
public boolean removeTrigger(String str)

Removes a previously added trigger. Returns true if it was present, false if not.

removeTriggerback to summary
public boolean removeTrigger(String[] strs)

Removes a previously added trigger. Returns true if it was present, false if not.

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

startCaptureback to summary
public synchronized void startCapture()
stopCaptureback to summary
public synchronized String stopCapture()
waitForback to summary
public synchronized boolean waitFor(String str, long millis)

Waits for the specified string to come in for the given period of time (measured in milliseconds).

sun.jvm.hotspot.utilities back to summary

pack-priv Class StreamMonitor.Trigger

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv
Trigger(String str, int val)

pack-priv
Trigger(String[] strs, int val)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
equals(String[] strs)

pack-priv boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

triggerStringsback to summary
private String[] triggerStrings
triggerValback to summary
private int triggerVal

Constructor Detail

Triggerback to summary
pack-priv Trigger(String str, int val)
Triggerback to summary
pack-priv Trigger(String[] strs, int val)

Method Detail

equalsback to summary
pack-priv boolean equals(String[] strs)
matchesback to summary
pack-priv boolean matches(String str)