javax.management
Class ObjectName

java.lang.Object
  |
  +--javax.management.ObjectName

public class ObjectName
extends java.lang.Object
implements java.io.Serializable

Represents the object name of an MBean. An instance of this class can be used to represent:

See Also:
Serialized Form

Constructor Summary
ObjectName(java.lang.String name)
          Allows an object name to be created from the given string.
ObjectName(java.lang.String domain, java.util.Hashtable table)
          Allows an object name with several key properties to be created.
ObjectName(java.lang.String domain, java.lang.String key, java.lang.String value)
          Allows an object name to be created using only one key property.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares the current object name with another object name.
 java.lang.String getCanonicalKeyPropertyListString()
          Returns a string representation of the list of key properties, in which the key properties are sorted in lexical order.
 java.lang.String getCanonicalName()
          Returns the canonical form of the name; that is, a string representation where the properties are sorted in lexical order.
 java.lang.String getDomain()
          Returns the domain part.
 java.lang.String getKeyProperty(java.lang.String property)
          Obtains the value of a key property in a key property.
 java.util.Hashtable getKeyPropertyList()
          Returns a pointer to the list of key properties.
 java.lang.String getKeyPropertyListString()
          Returns a string representation of the list of key properties specified at creation time.
 int hashCode()
          Returns a hash code for this object name.
 boolean isPattern()
          Checks whether the object name is a pattern for a query.
 boolean isPropertyPattern()
          Checks whether the object name is a pattern on the key properties.
 java.lang.String toString()
          Returns a string representation of the object name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectName

public ObjectName(java.lang.String name)
           throws MalformedObjectNameException
Allows an object name to be created from the given string. If the string does not have the right format a MalformedObjectNameException should be raised.
Parameters:
name - A string representation of the object name.
Throws:
MalformedObjectNameException - The string passed as a parameter does not have the right format.

ObjectName

public ObjectName(java.lang.String domain,
                  java.lang.String key,
                  java.lang.String value)
           throws MalformedObjectNameException
Allows an object name to be created using only one key property. If the parameters do not have the right format a MalformedObjectNameException should be raised.
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 - The string passed as a parameter does not have the right format.

ObjectName

public ObjectName(java.lang.String domain,
                  java.util.Hashtable table)
           throws MalformedObjectNameException
Allows an object name with several key properties to be created. If the parameters do not have the right format a MalformedObjectNameException should be raised.
Parameters:
domain - The domain part of the object name.
table - A hash table containing one or more search keys. Each search key is an attribute-value pair.
Throws:
MalformedObjectNameException - The string passed as a parameter does not have the right format.
Method Detail

equals

public boolean equals(java.lang.Object object)
Compares the current object name with another object name.
Overrides:
equals in class java.lang.Object
Parameters:
object - The object name that the current object name is to be compared with.
Returns:
True if the two object names are equal, otherwise false.

hashCode

public int hashCode()
Returns a hash code for this object name.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of the object name.
Overrides:
toString in class java.lang.Object

isPattern

public boolean isPattern()
Checks whether the object name is a pattern for a query.
Returns:
True if the name is a pattern, otherwise false.

getCanonicalName

public java.lang.String getCanonicalName()
Returns the canonical form of the name; that is, a string representation where the properties are sorted in lexical order.

getDomain

public java.lang.String getDomain()
Returns the domain part.

getKeyProperty

public java.lang.String getKeyProperty(java.lang.String property)
Obtains the value of a key property in a key property.
Parameters:
property - The property whose value is to be obtained.
Returns:
The value of the property.

getKeyPropertyList

public java.util.Hashtable getKeyPropertyList()
Returns a pointer to the list of key properties.

getKeyPropertyListString

public java.lang.String getKeyPropertyListString()
Returns a string representation of the list of key properties specified at creation time.

getCanonicalKeyPropertyListString

public 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.

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.