|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--javax.management.ObjectName
Represents the object name of an MBean, or a pattern that can match the names of several MBeans. Instances of this class are immutable.
An instance of this class can be used to represent:
An object name consists of two parts, the domain and the key properties.
The domain is a string of characters not including
the character colon (:).
If the domain includes at least one occurrence of the wildcard
characters asterisk (*) or question mark
(?), then the object name is a pattern. The asterisk
matches any sequence of zero or more characters, while the question
mark matches any single character.
If the domain is empty, it will be replaced in certain contexts by the default domain of the MBean server in which the ObjectName is used.
The key properties are an unordered set of keys and associated values.
Each key is a nonempty string of characters which may
not contain any of the characters comma (,), equals
(=), colon, asterisk, or question mark. The same key
may not occur twice in a given ObjectName.
Each value associated with a key is a string of characters that is either unquoted or quoted.
An unquoted value is a possibly empty string of characters which may not contain any of the characters comma, equals, colon, quote, asterisk, or question mark.
A quoted value consists of a quote ("),
followed by a possibly empty string of characters, followed by
another quote. Within the string of characters, the backslash
(\) has a special meaning. It must be followed by
one of the following characters:
A quote, question mark, or star may not appear inside a quoted value except immediately after an odd number of consecutive backslashes.
The quotes surrounding a quoted value, and any backslashes within that value, are considered to be part of the value.
An ObjectName may be a property pattern. In this case it may have zero or more keys and associated values. It matches a nonpattern ObjectName whose domain matches and that contains the same keys and associated values, as well as possibly other keys and values.
An ObjectName is a pattern if its domain contains a wildcard or if the ObjectName is a property pattern.
If an ObjectName is not a pattern, it must contain at least one key with its associated value.
An ObjectName can be written as a String with the following elements in order:
:).
A key property list written as a String is a comma-separated
list of elements. Each element is either an asterisk or a key
property. A key property consists of a key, an equals
(=), and the associated value.
At most one element of a key property list may be an asterisk. If the key property list contains an asterisk element, the ObjectName is a property pattern.
Spaces have no special significance in a String representing an ObjectName. For example, the String:
domain: key1 = value1 , key2 = value2represents an ObjectName with two keys. The name of each key contains six characters, of which the first and last are spaces. The value associated with the key
" key1 "
also begins and ends with a space.
In addition to the restrictions on characters spelt out above,
no part of an ObjectName may contain a newline character
('\n'), whether the domain, a key, or a value, whether
quoted or unquoted. The newline character can be represented in a
quoted value with the sequence \n.
The rules on special characters and quoting apply regardless of which constructor is used to make an ObjectName.
To avoid collisions between MBeans supplied by different
vendors, a useful convention is to begin the domain name with the
reverse DNS name of the organization that specifies the MBeans,
followed by a period and a string whose interpretation is
determined by that organization. For example, MBeans specified by
Sun Microsystems Inc., DNS name sun.com, would have
domains such as com.sun.MyDomain. This is essentially
the same convention as for Java-language package names.
| Constructor Summary | |
ObjectName(java.lang.String name)
|
|
ObjectName(java.lang.String domain,
java.util.Hashtable table)
|
|
ObjectName(java.lang.String domain,
java.lang.String key,
java.lang.String value)
|
|
| Method Summary | |
boolean |
apply(ObjectName name)
Applies the QueryExp on an MBean. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getCanonicalKeyPropertyListString()
|
java.lang.String |
getCanonicalName()
|
java.lang.String |
getDomain()
|
java.lang.String |
getKeyProperty(java.lang.String property)
|
java.util.Hashtable |
getKeyPropertyList()
|
java.lang.String |
getKeyPropertyListString()
|
int |
hashCode()
|
boolean |
isPattern()
|
boolean |
isPropertyPattern()
|
static void |
main(java.lang.String[] args)
|
void |
setMBeanServer(MBeanServer server)
Sets the MBean server on which the query is to be performed. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ObjectName(java.lang.String name)
throws MalformedObjectNameException
public ObjectName(java.lang.String domain,
java.lang.String key,
java.lang.String value)
throws MalformedObjectNameException
public ObjectName(java.lang.String domain,
java.util.Hashtable table)
throws MalformedObjectNameException
| Method Detail |
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isPattern()
public java.lang.String getCanonicalName()
public java.lang.String getDomain()
public java.lang.String getKeyProperty(java.lang.String property)
public java.util.Hashtable getKeyPropertyList()
public java.lang.String getKeyPropertyListString()
public java.lang.String getCanonicalKeyPropertyListString()
public boolean isPropertyPattern()
public boolean apply(ObjectName name)
throws BadStringOperationException,
BadBinaryOpValueExpException,
BadAttributeValueExpException,
InvalidApplicationException
QueryExp
apply in interface QueryExpname - The name of the MBean on which the QueryExp will be applied.
InvalidApplicationException
BadAttributeValueExpException
BadBinaryOpValueExpException
BadStringOperationExceptionpublic void setMBeanServer(MBeanServer server)
QueryExp
setMBeanServer in interface QueryExpserver - The MBean server on which the query is to be performed.
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||