javax.management
Class ObjectName

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.ObjectName
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , QueryExp sample code for javax.management.QueryExp definition code for javax.management.QueryExp

public class ObjectName
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements QueryExp sample code for javax.management.QueryExp definition code for javax.management.QueryExp , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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 = value2
 
represents 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.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
ObjectName sample code for javax.management.ObjectName.ObjectName(java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Construct an object name from the given string.
ObjectName sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) (String sample code for java.lang.String definition code for java.lang.String  domain, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  table)
          Construct an object name with several key properties from a Hashtable.
ObjectName sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  domain, String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  value)
          Construct an object name with exactly one key property.
 
Method Summary
 boolean apply sample code for javax.management.ObjectName.apply(javax.management.ObjectName) definition code for javax.management.ObjectName.apply(javax.management.ObjectName) (ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
          Test whether this ObjectName, which may be a pattern, matches another ObjectName.
 boolean equals sample code for javax.management.ObjectName.equals(java.lang.Object) definition code for javax.management.ObjectName.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  object)
          Compares the current object name with another object name.
 String sample code for java.lang.String definition code for java.lang.String getCanonicalKeyPropertyListString sample code for javax.management.ObjectName.getCanonicalKeyPropertyListString() definition code for javax.management.ObjectName.getCanonicalKeyPropertyListString() ()
          Returns a string representation of the list of key properties, in which the key properties are sorted in lexical order.
 String sample code for java.lang.String definition code for java.lang.String getCanonicalName sample code for javax.management.ObjectName.getCanonicalName() definition code for javax.management.ObjectName.getCanonicalName() ()
          Returns the canonical form of the name; that is, a string representation where the properties are sorted in lexical order.
 String sample code for java.lang.String definition code for java.lang.String getDomain sample code for javax.management.ObjectName.getDomain() definition code for javax.management.ObjectName.getDomain() ()
          Returns the domain part.
static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName getInstance sample code for javax.management.ObjectName.getInstance(javax.management.ObjectName) definition code for javax.management.ObjectName.getInstance(javax.management.ObjectName) (ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
          Return an instance of ObjectName that can be used anywhere the given object can be used.
static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String) definition code for javax.management.ObjectName.getInstance(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(name) sample code for javax.management.ObjectName.ObjectName(java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String) can be used.
static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName.getInstance(java.lang.String, java.util.Hashtable) (String sample code for java.lang.String definition code for java.lang.String  domain, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  table)
          Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(domain, table) sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) can be used.
static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName.getInstance(java.lang.String, java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  domain, String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  value)
          Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(domain, key, value) sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) can be used.
 String sample code for java.lang.String definition code for java.lang.String getKeyProperty sample code for javax.management.ObjectName.getKeyProperty(java.lang.String) definition code for javax.management.ObjectName.getKeyProperty(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  property)
          Obtains the value associated with a key in a key property.
 Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable getKeyPropertyList sample code for javax.management.ObjectName.getKeyPropertyList() definition code for javax.management.ObjectName.getKeyPropertyList() ()
          Returns the key properties as a Hashtable.
 String sample code for java.lang.String definition code for java.lang.String getKeyPropertyListString sample code for javax.management.ObjectName.getKeyPropertyListString() definition code for javax.management.ObjectName.getKeyPropertyListString() ()
          Returns a string representation of the list of key properties specified at creation time.
 int hashCode sample code for javax.management.ObjectName.hashCode() definition code for javax.management.ObjectName.hashCode() ()
          Returns a hash code for this object name.
 boolean isDomainPattern sample code for javax.management.ObjectName.isDomainPattern() definition code for javax.management.ObjectName.isDomainPattern() ()
          Checks whether the object name is a pattern on the domain part.
 boolean isPattern sample code for javax.management.ObjectName.isPattern() definition code for javax.management.ObjectName.isPattern() ()
          Checks whether the object name is a pattern.
 boolean isPropertyPattern sample code for javax.management.ObjectName.isPropertyPattern() definition code for javax.management.ObjectName.isPropertyPattern() ()
          Checks whether the object name is a pattern on the key properties.
static String sample code for java.lang.String definition code for java.lang.String quote sample code for javax.management.ObjectName.quote(java.lang.String) definition code for javax.management.ObjectName.quote(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  s)
          Returns a quoted form of the given String, suitable for inclusion in an ObjectName.
 void setMBeanServer sample code for javax.management.ObjectName.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.ObjectName.setMBeanServer(javax.management.MBeanServer) (MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  mbs)
          Sets the MBean server on which the query is to be performed.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.management.ObjectName.toString() definition code for javax.management.ObjectName.toString() ()
          Returns a string representation of the object name.
static String sample code for java.lang.String definition code for java.lang.String unquote sample code for javax.management.ObjectName.unquote(java.lang.String) definition code for javax.management.ObjectName.unquote(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  q)
          Returns an unquoted form of the given String.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ObjectName sample code for javax.management.ObjectName(java.lang.String) definition code for javax.management.ObjectName(java.lang.String)

public ObjectName(String sample code for java.lang.String definition code for java.lang.String  name)
           throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                  NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 
Construct an object name from the given string.

Parameters:
name - A string representation of the object name.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The string passed as a parameter does not have the right format.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - The name parameter is null.

ObjectName sample code for javax.management.ObjectName(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName(java.lang.String, java.lang.String, java.lang.String)

public ObjectName(String sample code for java.lang.String definition code for java.lang.String  domain,
                  String sample code for java.lang.String definition code for java.lang.String  key,
                  String sample code for java.lang.String definition code for java.lang.String  value)
           throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                  NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 
Construct an object name with exactly one key property.

Parameters:
domain - The domain part of the object name.
key - The attribute in the key property of the object name.
value - The value in the key property of the object name.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The domain, key, or value contains an illegal character, or value does not follow the rules for quoting.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - One of the parameters is null.

ObjectName sample code for javax.management.ObjectName(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName(java.lang.String, java.util.Hashtable)

public ObjectName(String sample code for java.lang.String definition code for java.lang.String  domain,
                  Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  table)
           throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                  NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 
Construct an object name with several key properties from a Hashtable.

Parameters:
domain - The domain part of the object name.
table - A hash table containing one or more key properties. The key of each entry in the table is the key of a key property in the object name. The associated value in the table is the associated value in the object name.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The domain contains an illegal character, or one of the keys or values in table contains an illegal character, or one of the values in table does not follow the rules for quoting.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - One of the parameters is null.
Method Detail

getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String) definition code for javax.management.ObjectName.getInstance(java.lang.String)

public static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  getInstance(String sample code for java.lang.String definition code for java.lang.String  name)
                              throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                                     NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(name) sample code for javax.management.ObjectName.ObjectName(java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String) can be used. The returned object may be of a subclass of ObjectName. Calling this method twice with the same parameters may return the same object or two equal but not identical objects.

Parameters:
name - A string representation of the object name.
Returns:
an ObjectName corresponding to the given String.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The string passed as a parameter does not have the right format.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - The name parameter is null.

getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName.getInstance(java.lang.String, java.lang.String, java.lang.String)

public static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  getInstance(String sample code for java.lang.String definition code for java.lang.String  domain,
                                     String sample code for java.lang.String definition code for java.lang.String  key,
                                     String sample code for java.lang.String definition code for java.lang.String  value)
                              throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                                     NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(domain, key, value) sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.lang.String, java.lang.String) can be used. The returned object may be of a subclass of ObjectName. Calling this method twice with the same parameters may return the same object or two equal but not identical objects.

Parameters:
domain - The domain part of the object name.
key - The attribute in the key property of the object name.
value - The value in the key property of the object name.
Returns:
an ObjectName corresponding to the given domain, key, and value.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The domain, key, or value contains an illegal character, or value does not follow the rules for quoting.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - One of the parameters is null.

getInstance sample code for javax.management.ObjectName.getInstance(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName.getInstance(java.lang.String, java.util.Hashtable)

public static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  getInstance(String sample code for java.lang.String definition code for java.lang.String  domain,
                                     Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  table)
                              throws MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException ,
                                     NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Return an instance of ObjectName that can be used anywhere an object obtained with new ObjectName(domain, table) sample code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) definition code for javax.management.ObjectName.ObjectName(java.lang.String, java.util.Hashtable) can be used. The returned object may be of a subclass of ObjectName. Calling this method twice with the same parameters may return the same object or two equal but not identical objects.

Parameters:
domain - The domain part of the object name.
table - A hash table containing one or more key properties. The key of each entry in the table is the key of a key property in the object name. The associated value in the table is the associated value in the object name.
Returns:
an ObjectName corresponding to the given domain and key mappings.
Throws:
MalformedObjectNameException sample code for javax.management.MalformedObjectNameException definition code for javax.management.MalformedObjectNameException - The domain contains an illegal character, or one of the keys or values in table contains an illegal character, or one of the values in table does not follow the rules for quoting.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - One of the parameters is null.

getInstance sample code for javax.management.ObjectName.getInstance(javax.management.ObjectName) definition code for javax.management.ObjectName.getInstance(javax.management.ObjectName)

public static ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  getInstance(ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
                              throws NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Return an instance of ObjectName that can be used anywhere the given object can be used. The returned object may be of a subclass of ObjectName. If name is of a subclass of ObjectName, it is not guaranteed that the returned object will be of the same class.

The returned value may or may not be identical to name. Calling this method twice with the same parameters may return the same object or two equal but not identical objects.

Since ObjectName is immutable, it is not usually useful to make a copy of an ObjectName. The principal use of this method is to guard against a malicious caller who might pass an instance of a subclass with surprising behavior to sensitive code. Such code can call this method to obtain an ObjectName that is known not to have surprising behavior.

Parameters:
name - an instance of the ObjectName class or of a subclass
Returns:
an instance of ObjectName or a subclass that is known to have the same semantics. If name respects the semantics of ObjectName, then the returned object is equal (though not necessarily identical) to name.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - The name is null.

isPattern sample code for javax.management.ObjectName.isPattern() definition code for javax.management.ObjectName.isPattern()

public boolean isPattern()
Checks whether the object name is a pattern. An object name is a pattern if its domain contains a wildcard or if the object name is a property pattern.

Returns:
True if the name is a pattern, otherwise false.

isDomainPattern sample code for javax.management.ObjectName.isDomainPattern() definition code for javax.management.ObjectName.isDomainPattern()

public boolean isDomainPattern()
Checks whether the object name is a pattern on the domain part.

Returns:
True if the name is a domain pattern, otherwise false.

isPropertyPattern sample code for javax.management.ObjectName.isPropertyPattern() definition code for javax.management.ObjectName.isPropertyPattern()

public boolean isPropertyPattern()
Checks whether the object name is a pattern on the key properties.

Returns:
True if the name is a pattern, otherwise false.

getCanonicalName sample code for javax.management.ObjectName.getCanonicalName() definition code for javax.management.ObjectName.getCanonicalName()

public String sample code for java.lang.String definition code for java.lang.String  getCanonicalName()

Returns the canonical form of the name; that is, a string representation where the properties are sorted in lexical order.

More precisely, the canonical form of the name is a String consisting of the domain part, a colon (:), the canonical key property list, and a pattern indication.

The canonical key property list is the same string as described for getCanonicalKeyPropertyListString() sample code for javax.management.ObjectName.getCanonicalKeyPropertyListString() definition code for javax.management.ObjectName.getCanonicalKeyPropertyListString() .

The pattern indication is:

Returns:
The canonical form of the name.

getDomain sample code for javax.management.ObjectName.getDomain() definition code for javax.management.ObjectName.getDomain()

public String sample code for java.lang.String definition code for java.lang.String  getDomain()
Returns the domain part.

Returns:
the domain.

getKeyProperty sample code for javax.management.ObjectName.getKeyProperty(java.lang.String) definition code for javax.management.ObjectName.getKeyProperty(java.lang.String)

public String sample code for java.lang.String definition code for java.lang.String  getKeyProperty(String sample code for java.lang.String definition code for java.lang.String  property)
                      throws NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 
Obtains the value associated with a key in a key property.

Parameters:
property - The property whose value is to be obtained.
Returns:
The value of the property, or null if there is no such property in this ObjectName.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - If property is null.

getKeyPropertyList sample code for javax.management.ObjectName.getKeyPropertyList() definition code for javax.management.ObjectName.getKeyPropertyList()

public Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  getKeyPropertyList()

Returns the key properties as a Hashtable. The returned value is a Hashtable in which each key is a key in the ObjectName's key property list and each value is the associated value.

The returned value may be unmodifiable. If it is modifiable, changing it has no effect on this ObjectName.

Returns:
The table of key properties.

getKeyPropertyListString sample code for javax.management.ObjectName.getKeyPropertyListString() definition code for javax.management.ObjectName.getKeyPropertyListString()

public String sample code for java.lang.String definition code for java.lang.String  getKeyPropertyListString()

Returns a string representation of the list of key properties specified at creation time. If this ObjectName was constructed with the constructor ObjectName(String) sample code for javax.management.ObjectName.ObjectName(java.lang.String) definition code for javax.management.ObjectName.ObjectName(java.lang.String) , the key properties in the returned String will be in the same order as in the argument to the constructor.

Returns:
The key property list string. This string is independent of whether the ObjectName is a pattern.

getCanonicalKeyPropertyListString sample code for javax.management.ObjectName.getCanonicalKeyPropertyListString() definition code for javax.management.ObjectName.getCanonicalKeyPropertyListString()

public String sample code for java.lang.String definition code for java.lang.String  getCanonicalKeyPropertyListString()
Returns a string representation of the list of key properties, in which the key properties are sorted in lexical order. This is used in lexicographic comparisons performed in order to select MBeans based on their key property list. Lexical order is the order implied by String.compareTo(String) sample code for java.lang.String.compareTo(java.lang.String) definition code for java.lang.String.compareTo(java.lang.String) .

Returns:
The canonical key property list string. This string is independent of whether the ObjectName is a pattern.

toString sample code for javax.management.ObjectName.toString() definition code for javax.management.ObjectName.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()

Returns a string representation of the object name. The format of this string is not specified, but users can expect that two ObjectNames return the same string if and only if they are equal.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string representation of this object name.

equals sample code for javax.management.ObjectName.equals(java.lang.Object) definition code for javax.management.ObjectName.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  object)
Compares the current object name with another object name. Two ObjectName instances are equal if and only if their canonical forms are equal. The canonical form is the string described for getCanonicalName() sample code for javax.management.ObjectName.getCanonicalName() definition code for javax.management.ObjectName.getCanonicalName() .

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
object - The object name that the current object name is to be compared with.
Returns:
True if object is an ObjectName whose canonical form is equal to that of this ObjectName.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.management.ObjectName.hashCode() definition code for javax.management.ObjectName.hashCode()

public int hashCode()
Returns a hash code for this object name.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

quote sample code for javax.management.ObjectName.quote(java.lang.String) definition code for javax.management.ObjectName.quote(java.lang.String)

public static String sample code for java.lang.String definition code for java.lang.String  quote(String sample code for java.lang.String definition code for java.lang.String  s)
                    throws NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Returns a quoted form of the given String, suitable for inclusion in an ObjectName. The returned value can be used as the value associated with a key in an ObjectName. The String s may contain any character. Appropriate quoting ensures that the returned value is legal in an ObjectName.

The returned value consists of a quote ('"'), a sequence of characters corresponding to the characters of s, and another quote. Characters in s appear unchanged within the returned value except:

Parameters:
s - the String to be quoted.
Returns:
the quoted String.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if s is null.

unquote sample code for javax.management.ObjectName.unquote(java.lang.String) definition code for javax.management.ObjectName.unquote(java.lang.String)

public static String sample code for java.lang.String definition code for java.lang.String  unquote(String sample code for java.lang.String definition code for java.lang.String  q)
                      throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                             NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Returns an unquoted form of the given String. If q is a String returned by quote(s) sample code for javax.management.ObjectName.quote(java.lang.String) definition code for javax.management.ObjectName.quote(java.lang.String) , then unquote(q).equals(s). If there is no String s for which quote(s).equals(q), then unquote(q) throws an IllegalArgumentException.

These rules imply that there is a one-to-one mapping between quoted and unquoted forms.

Parameters:
q - the String to be unquoted.
Returns:
the unquoted String.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if q could not have been returned by the quote(java.lang.String) sample code for javax.management.ObjectName.quote(java.lang.String) definition code for javax.management.ObjectName.quote(java.lang.String) method, for instance if it does not begin and end with a quote (").
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if q is null.

apply sample code for javax.management.ObjectName.apply(javax.management.ObjectName) definition code for javax.management.ObjectName.apply(javax.management.ObjectName)

public boolean apply(ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
              throws NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException 

Test whether this ObjectName, which may be a pattern, matches another ObjectName. If name is a pattern, the result is false. If this ObjectName is a pattern, the result is true if and only if name matches the pattern. If neither this ObjectName nor name is a pattern, the result is true if and only if the two ObjectNames are equal as described for the equals(Object) sample code for javax.management.ObjectName.equals(java.lang.Object) definition code for javax.management.ObjectName.equals(java.lang.Object) method.

Specified by:
apply sample code for javax.management.QueryExp.apply(javax.management.ObjectName) definition code for javax.management.QueryExp.apply(javax.management.ObjectName) in interface QueryExp sample code for javax.management.QueryExp definition code for javax.management.QueryExp
Parameters:
name - The name of the MBean to compare to.
Returns:
True if name matches this ObjectName.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if name is null.

setMBeanServer sample code for javax.management.ObjectName.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.ObjectName.setMBeanServer(javax.management.MBeanServer)

public void setMBeanServer(MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  mbs)
Description copied from interface: QueryExp sample code for javax.management.QueryExp.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.QueryExp.setMBeanServer(javax.management.MBeanServer)
Sets the MBean server on which the query is to be performed.

Specified by:
setMBeanServer sample code for javax.management.QueryExp.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.QueryExp.setMBeanServer(javax.management.MBeanServer) in interface QueryExp sample code for javax.management.QueryExp definition code for javax.management.QueryExp
Parameters:
mbs - The MBean server on which the query is to be performed.