javax.management
Class ObjectName

java.lang.Object
  extended byjavax.management.ObjectName
All Implemented Interfaces:
QueryExp, Serializable

public class ObjectName
extends Object
implements Serializable, QueryExp

Object name represents the MBean reference.

Version:
$Revision: 1.10.4.4 $

Revisions:

20020521 Adrian Brock:

20020710 Adrian Brock:

Author:
Juha Lindfors., Trevor Squires., Adrian Brock.
See Also:
MBeanServer, Serialized Form

Constructor Summary
ObjectName(String name)
           
ObjectName(String domain, Hashtable table)
          Construct a new ObjectName
ObjectName(String domain, String key, String value)
          Construct a new ObjectName
 
Method Summary
 boolean apply(ObjectName name)
          Apply this query expression to an MBean.
 boolean equals(Object object)
           
 String getCanonicalKeyPropertyListString()
           
 String getCanonicalName()
           
 String getDomain()
           
static ObjectName getInstance(String name)
          Return an instance of an ObjectName
static ObjectName getInstance(String domain, Hashtable table)
          Return an instance of an ObjectName
static ObjectName getInstance(String domain, String key, String value)
          Return an instance of an ObjectName
 String getKeyProperty(String property)
           
 Hashtable getKeyPropertyList()
           
 String getKeyPropertyListString()
           
 int hashCode()
           
 boolean isDomainPattern()
           
 boolean isPattern()
           
 boolean isPropertyPattern()
           
static String quote(String value)
          Quotes the passed string suitable for use as a value in an ObjectName.
 void setMBeanServer(MBeanServer server)
          Set the MBeanServer for this query.
 String toString()
           
static String unquote(String value)
          Unquotes a string, unquote(quote(s)).equals(s) is always true.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectName

public ObjectName(String name)
           throws MalformedObjectNameException
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null name

ObjectName

public ObjectName(String domain,
                  String key,
                  String value)
           throws MalformedObjectNameException
Construct a new ObjectName

Parameters:
domain - the domain of the object name
key - the key of the single property
value - the value of the single property
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null parameter

ObjectName

public ObjectName(String domain,
                  Hashtable table)
           throws MalformedObjectNameException
Construct a new ObjectName

Parameters:
domain - the domain of the object name
table - of hashtable for key property pairs
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null parameter
Method Detail

getInstance

public static ObjectName getInstance(String name)
                              throws MalformedObjectNameException
Return an instance of an ObjectName

Parameters:
name - a string representation of the object name
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null name

getInstance

public static ObjectName getInstance(String domain,
                                     String key,
                                     String value)
                              throws MalformedObjectNameException
Return an instance of an ObjectName

Parameters:
domain - the domain of the object name
key - the key of the single property
value - the value of the single property
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null parameter

getInstance

public static ObjectName getInstance(String domain,
                                     Hashtable table)
                              throws MalformedObjectNameException
Return an instance of an ObjectName

Parameters:
domain - the domain of the object name
table - of hashtable for key property pairs
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null parameter

quote

public static String quote(String value)
Quotes the passed string suitable for use as a value in an ObjectName.

Parameters:
value - the string to quote
Returns:
the quoted string
Throws:
NullPointerException - for a null string

unquote

public static String unquote(String value)
Unquotes a string, unquote(quote(s)).equals(s) is always true.

Parameters:
value - the string to unquote
Returns:
the unquoted string
Throws:
IllegalArgumentException - when the string is not of a form that can be unquoted.
NullPointerException - for a null string

equals

public boolean equals(Object object)

hashCode

public int hashCode()

toString

public String toString()

isPattern

public boolean isPattern()

getCanonicalName

public String getCanonicalName()

getDomain

public String getDomain()

getKeyProperty

public String getKeyProperty(String property)

getKeyPropertyList

public Hashtable getKeyPropertyList()

getKeyPropertyListString

public String getKeyPropertyListString()

getCanonicalKeyPropertyListString

public String getCanonicalKeyPropertyListString()

isPropertyPattern

public boolean isPropertyPattern()

isDomainPattern

public boolean isDomainPattern()

apply

public boolean apply(ObjectName name)
              throws BadStringOperationException,
                     BadBinaryOpValueExpException,
                     BadAttributeValueExpException,
                     InvalidApplicationException
Description copied from interface: QueryExp
Apply this query expression to an MBean.

Specified by:
apply in interface QueryExp
Parameters:
name - the object name of the mbean
Returns:
true or false as the result of the query expression.
Throws:
BadStringOperationException - when an invalid string operation is used during query construction
InvalidApplicationException - when trying to apply a subquery expression to an MBean or an attribute expression to an MBean of the wrong class.
BadBinaryOpValueExpException - when an invalid binary operation is used during query construction
BadAttributeValueExpException - when an invalid MBean attribute is used during query construction

setMBeanServer

public void setMBeanServer(MBeanServer server)
Description copied from interface: QueryExp
Set the MBeanServer for this query. Only MBeans registered in this server can be used in queries.

Specified by:
setMBeanServer in interface QueryExp
Parameters:
server - the MBeanServer


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.