|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensolaris.os.dtrace.ProbeDescription
public final class ProbeDescription
A DTrace probe description consists of provider, module, function, and name. A single probe description may identify a single DTrace probe or match multiple probes. Any field may be wildcarded by omission (set to null) or set to a glob-style pattern:
* Matches any string, including the null string ? Matches any single character [ ... ] Matches any one of the enclosed characters. A pair of characters separated by - matches any character between the pair, inclusive. If the first character after the [ is !, any character not enclosed in the set is matched. \ Interpret the next character as itself, without any special meaningImmutable. Supports persistence using
XMLEncoder
.
Consumer.listProbes(ProbeDescription filter)
,
Serialized FormNested Class Summary | |
---|---|
static class |
ProbeDescription.Spec
Enumerates the provider, module, function, and name fields of a probe description. |
Field Summary | |
---|---|
static ProbeDescription |
EMPTY
Instance with empty provider, module, function, and name fields matches all DTrace probes on a system. |
Constructor Summary | |
---|---|
ProbeDescription(int probeID,
java.lang.String probeProvider,
java.lang.String probeModule,
java.lang.String probeFunction,
java.lang.String probeName)
Supports XML persistence. |
|
ProbeDescription(java.lang.String probeName)
Creates a fully qualified probe description from the name given in the format provider:module:function:name or
else a probe description that specifies only the unqualified
probe name. |
|
ProbeDescription(java.lang.String probeFunction,
java.lang.String probeName)
Creates a probe description that specifies the probe name qualified only by the function name. |
|
ProbeDescription(java.lang.String probeModule,
java.lang.String probeFunction,
java.lang.String probeName)
Creates a probe description that specifies the probe name qualified by the function name and module name. |
|
ProbeDescription(java.lang.String probeProvider,
java.lang.String probeModule,
java.lang.String probeFunction,
java.lang.String probeName)
Creates a fully qualified probe description. |
Method Summary | |
---|---|
int |
compareTo(ProbeDescription p)
Defines the natural ordering of probe descriptions. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this probe description for equality. |
java.lang.String |
getFunction()
Gets the function name. |
int |
getID()
Gets the probe ID. |
java.lang.String |
getModule()
Gets the module name. |
java.lang.String |
getName()
Gets the unqualified probe name. |
java.lang.String |
getProvider()
Gets the provider name. |
int |
hashCode()
Overridden to ensure that equal probe descriptions have equal hashcodes. |
boolean |
isEmpty()
Returns true if provider, module, function, and name are
all omitted. |
static ProbeDescription |
parse(java.lang.String s)
Generates a probe description from a string in the same format returned by toString() . |
java.lang.String |
toString()
Gets the string representation of this probe description. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ProbeDescription EMPTY
Constructor Detail |
---|
public ProbeDescription(java.lang.String probeName)
provider:module:function:name
or
else a probe description that specifies only the unqualified
probe name.
probeName
- either the fully qualified name in the format
provider:module:function:name
or else (if no colon
is present) the unqualified name interpreted as :::probeName
ProbeDescription(String probeProvider,
String probeModule, String probeFunction, String probeName)
,
parse(String s)
public ProbeDescription(java.lang.String probeFunction, java.lang.String probeName)
ProbeDescription(String probeProvider,
String probeModule, String probeFunction, String probeName)
public ProbeDescription(java.lang.String probeModule, java.lang.String probeFunction, java.lang.String probeName)
ProbeDescription(String probeProvider,
String probeModule, String probeFunction, String probeName)
public ProbeDescription(java.lang.String probeProvider, java.lang.String probeModule, java.lang.String probeFunction, java.lang.String probeName)
probeProvider
- provider name, may be null or empty to match
all providers or use pattern syntax to match multiple providersprobeModule
- module name, may be null or empty to match all
modules or use pattern syntax to match multiple modulesprobeFunction
- function name, may be null or empty to match
all functions or use pattern syntax to match multiple functionsprobeName
- unqualified probe name, may be null or empty to
match all names or use pattern syntax to match multiple namespublic ProbeDescription(int probeID, java.lang.String probeProvider, java.lang.String probeModule, java.lang.String probeFunction, java.lang.String probeName)
Method Detail |
---|
public static ProbeDescription parse(java.lang.String s) throws java.text.ParseException
toString()
. Parses the string from right to
left.
provider:module:function:name
java.text.ParseException
- if s
does not have the expected
format. The error offset is the index of the first unexpected
character encountered starting from the last character and
reading backwards.
java.lang.NullPointerException
- if the given string is null
public int getID()
public java.lang.String getProvider()
public java.lang.String getModule()
public java.lang.String getFunction()
public java.lang.String getName()
public boolean isEmpty()
true
if provider, module, function, and name are
all omitted. An empty probe description matches all DTrace
probes on a system.
true
if all probe fields are omitted, false
otherwisepublic boolean equals(java.lang.Object o)
null
or empty
string was used to indicate omission.
equals
in class java.lang.Object
true
if and only if all corresponding fields of
both probe descriptions are either both omitted (null or empty)
or else equal as defined by String.equals()
public int compareTo(ProbeDescription p)
String.equals()
. It makes no difference if null
or
empty string is used to indicate omission. The behavior is
consistent with the equals()
method.
compareTo
in interface java.lang.Comparable<ProbeDescription>
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
provider:module:function:name
Individual fields may be empty, but none of the three delimiting
colons is ever omitted. If this instance uses pattern matching
syntax to match multiple probes, that syntax is preserved in the
string representation.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |