ObjectInstancepublic class ObjectInstance extends Object implements SerializableUsed to represent the object name of an MBean and its class name.
If the MBean is a Dynamic MBean the class name should be retrieved from
the MBeanInfo it provides. |
Fields Summary |
---|
private static final long | serialVersionUID | private ObjectName | name | private String | className |
Constructors Summary |
---|
public ObjectInstance(String objectName, String className)Allows an object instance to be created given a string representation of
an object name and the full class name, including the package name.
this(new ObjectName(objectName), className);
| public ObjectInstance(ObjectName objectName, String className)Allows an object instance to be created given an object name and
the full class name, including the package name.
if (objectName.isPattern()) {
final IllegalArgumentException iae =
new IllegalArgumentException("Invalid name->"+
objectName.toString());
throw new RuntimeOperationsException(iae);
}
this.name= objectName;
this.className= className;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object object)Compares the current object instance with another object instance.
if (!(object instanceof ObjectInstance)) {
return false;
}
ObjectInstance val = (ObjectInstance) object;
if (! name.equals(val.getObjectName())) return false;
if (className == null)
return (val.getClassName() == null);
return className.equals(val.getClassName());
| public java.lang.String | getClassName()Returns the class part.
return className;
| public javax.management.ObjectName | getObjectName()Returns the object name part.
return name;
| public int | hashCode()
final int classHash = ((className==null)?0:className.hashCode());
return name.hashCode() ^ classHash;
| public java.lang.String | toString()Returns a string representing this ObjectInstance object. The format of this string
is not specified, but users can expect that two ObjectInstances return the same
string if and only if they are equal.
return getClassName() + "[" + getObjectName() + "]";
|
|