站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

ObjectName (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


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.29 $

Revisions:

20020521 Adrian Brock:

  • Allow *,* in the hashtable properties to signify a property pattern

20020710 Adrian Brock:

  • Serialization

    20030114 Adrian Brock:

    • Valid character changes for 1.2
    • The new line character is not allowed anywhere in the ObjectName, because of a bodge in the relation service
    • Domains can now contain = and ,
    • Keys are unchanged except for the new line restriction
    • For values, "?* are allowed providing they are proceeed by a \ and the escaping is in enclosed in a "" pair. A new line must be \n inside a "" pair. =,: are allowed inside a "" pair.
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()
          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.
 String getDomain()
           
static ObjectName getInstance(ObjectName name)
          Return an instance of ObjectName that can be used anywhere the given object can be used.
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()
          Construct the key property list, ignoring patters Note, it might not be the same order
 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,
                  NullPointerException
Parameters:
name - a string representation of the object name
Throws:
MalformedObjectNameException - for an invalid object name
NullPointerException - for a null name

ObjectName

public ObjectName(String domain,
                  String key,
                  String value)
           throws MalformedObjectNameException,
                  NullPointerException
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,
                  NullPointerException
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,
                                     NullPointerException
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,
                                     NullPointerException
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,
                                     NullPointerException
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

getInstance

public static ObjectName getInstance(ObjectName name)
                              throws 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 behaviour to sensitive code. Such code can call this method to obtain an ObjectName that is known not to have surprising behaviour.

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

quote

public static String quote(String value)
                    throws NullPointerException
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)
                      throws IllegalArgumentException,
                             NullPointerException
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()
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(). The pattern indication is: - empty for an ObjectName that is not a property pattern; - an asterisk for an ObjectName that is a property pattern with no keys; or - a comma and an asterisk (,*) for an ObjectName that is a property pattern with at least one key.


getDomain

public String getDomain()

getKeyProperty

public String getKeyProperty(String property)
                      throws NullPointerException
Throws:
NullPointerException

getKeyPropertyList

public Hashtable getKeyPropertyList()

getKeyPropertyListString

public String getKeyPropertyListString()
Construct the key property list, ignoring patters Note, it might not be the same order


getCanonicalKeyPropertyListString

public String getCanonicalKeyPropertyListString()

isPropertyPattern

public boolean isPropertyPattern()

isDomainPattern

public boolean isDomainPattern()

apply

public boolean apply(ObjectName name)
              throws NullPointerException
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:
NullPointerException

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.