MBeanConstructorInfopublic class MBeanConstructorInfo extends MBeanFeatureInfo implements CloneableDescribes a constructor exposed by an MBean. Instances of this
class are immutable. Subclasses may be mutable but this is not
recommended. |
Fields Summary |
---|
static final long | serialVersionUID | static final MBeanConstructorInfo[] | NO_CONSTRUCTORS | private final transient boolean | arrayGettersSafe | private final MBeanParameterInfo[] | signature |
Constructors Summary |
---|
public MBeanConstructorInfo(String description, Constructor constructor)Constructs an MBeanConstructorInfo object. The
{@link Descriptor} of the constructed object will include
fields contributed by any annotations on the {@code
Constructor} object that contain the {@link DescriptorKey}
meta-annotation.
this(constructor.getName(), description,
constructorSignature(constructor),
Introspector.descriptorForElement(constructor));
| public MBeanConstructorInfo(String name, String description, MBeanParameterInfo[] signature)Constructs an MBeanConstructorInfo object.
this(name, description, signature, null);
| public MBeanConstructorInfo(String name, String description, MBeanParameterInfo[] signature, Descriptor descriptor)Constructs an MBeanConstructorInfo object.
super(name, description, descriptor);
if (signature == null || signature.length == 0)
signature = MBeanParameterInfo.NO_PARAMS;
else
signature = (MBeanParameterInfo[]) signature.clone();
this.signature = signature;
this.arrayGettersSafe =
MBeanInfo.arrayGettersSafe(this.getClass(),
MBeanConstructorInfo.class);
|
Methods Summary |
---|
public java.lang.Object | clone()Returns a shallow clone of this instance. The clone is
obtained by simply calling super.clone(), thus calling
the default native shallow cloning mechanism implemented by
Object.clone(). No deeper cloning of any internal
field is made.
Since this class is immutable, cloning is chiefly of
interest to subclasses.
try {
return super.clone() ;
} catch (CloneNotSupportedException e) {
// should not happen as this class is cloneable
return null;
}
| private static javax.management.MBeanParameterInfo[] | constructorSignature(java.lang.reflect.Constructor cn)
final Class[] classes = cn.getParameterTypes();
final Annotation[][] annots = cn.getParameterAnnotations();
return MBeanOperationInfo.parameters(classes, annots);
| public boolean | equals(java.lang.Object o)Compare this MBeanConstructorInfo to another.
if (o == this)
return true;
if (!(o instanceof MBeanConstructorInfo))
return false;
MBeanConstructorInfo p = (MBeanConstructorInfo) o;
return (p.getName().equals(getName()) &&
p.getDescription().equals(getDescription()) &&
Arrays.equals(p.fastGetSignature(), fastGetSignature()) &&
p.getDescriptor().equals(getDescriptor()));
| private javax.management.MBeanParameterInfo[] | fastGetSignature()
if (arrayGettersSafe)
return signature;
else
return getSignature();
| public javax.management.MBeanParameterInfo[] | getSignature()Returns the list of parameters for this constructor. Each
parameter is described by an MBeanParameterInfo
object.
The returned array is a shallow copy of the internal array,
which means that it is a copy of the internal array of
references to the MBeanParameterInfo objects but
that each referenced MBeanParameterInfo object is
not copied.
if (signature.length == 0)
return signature;
else
return (MBeanParameterInfo[]) signature.clone();
| public int | hashCode()
int hash = getName().hashCode();
MBeanParameterInfo[] sig = fastGetSignature();
for (int i = 0; i < sig.length; i++)
hash ^= sig[i].hashCode();
return hash;
| public java.lang.String | toString()
return
getClass().getName() + "[" +
"description=" + getDescription() + ", " +
"name=" + getName() + ", " +
"signature=" + Arrays.asList(fastGetSignature()) + ", " +
"descriptor=" + getDescriptor() +
"]";
|
|