Methods Summary |
---|
private static final void | debug(java.lang.String clz, java.lang.String func, java.lang.String info)
Trace.send(Trace.LEVEL_DEBUG, Trace.INFO_MBEANSERVER, clz, func, info);
|
private static final void | debug(java.lang.String func, java.lang.String info)
debug(dbgTag, func, info);
|
public java.lang.Object | getAttribute(java.lang.String attribute)Obtains the value of a specific attribute of the MBeanServerDelegate.
try {
// attribute must not be null
//
if (attribute == null)
throw new AttributeNotFoundException("null");
// Extract the requested attribute from file
//
if (attribute.equals("MBeanServerId"))
return getMBeanServerId();
else if (attribute.equals("SpecificationName"))
return getSpecificationName();
else if (attribute.equals("SpecificationVersion"))
return getSpecificationVersion();
else if (attribute.equals("SpecificationVendor"))
return getSpecificationVendor();
else if (attribute.equals("ImplementationName"))
return getImplementationName();
else if (attribute.equals("ImplementationVersion"))
return getImplementationVersion();
else if (attribute.equals("ImplementationVendor"))
return getImplementationVendor();
// Unknown attribute
//
else
throw new AttributeNotFoundException("null");
} catch (AttributeNotFoundException x) {
throw x;
} catch (JMRuntimeException j) {
throw j;
} catch (SecurityException s) {
throw s;
} catch (Exception x) {
throw new MBeanException(x,"Failed to get " + attribute);
}
|
public javax.management.AttributeList | getAttributes(java.lang.String[] attributes)Makes it possible to get the values of several attributes of
the MBeanServerDelegate.
// If attributes is null, the get all attributes.
//
final String[] attn = (attributes==null?attributeNames:attributes);
// Prepare the result list.
//
final int len = attn.length;
final AttributeList list = new AttributeList(len);
// Get each requested attribute.
//
for (int i=0;i<len;i++) {
try {
final Attribute a =
new Attribute(attn[i],getAttribute(attn[i]));
list.add(a);
} catch (Exception x) {
// Skip the attribute that couldn't be obtained.
//
debug("getAttributes","Attribute " + attn[i] +
" not found.");
}
}
// Finally return the result.
//
return list;
|
public javax.management.MBeanInfo | getMBeanInfo()Provides the MBeanInfo describing the MBeanServerDelegate.
return delegateInfo;
|
public java.lang.Object | invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)Always fails since the MBeanServerDelegate MBean has no operation.
// Check that operation name is not null.
//
if (actionName == null) {
final RuntimeException r =
new IllegalArgumentException("Operation name cannot be null");
throw new RuntimeOperationsException(r,
"Exception occurred trying to invoke the operation on the MBean");
}
throw new ReflectionException(
new NoSuchMethodException(actionName),
"The operation with name " + actionName +
" could not be found");
|
private static final boolean | isDebugOn()
return Trace.isSelected(Trace.LEVEL_DEBUG, Trace.INFO_MBEANSERVER);
|
private static final boolean | isTraceOn()
return Trace.isSelected(Trace.LEVEL_TRACE, Trace.INFO_MBEANSERVER);
|
public final void | postDeregister()
|
public final void | postRegister(java.lang.Boolean registrationDone)
|
public final void | preDeregister()
throw new IllegalArgumentException(
"The MBeanServerDelegate MBean cannot be unregistered");
|
public final javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
if (name == null) return DELEGATE_NAME;
else return name;
|
public void | setAttribute(javax.management.Attribute attribute)This method always fail since all MBeanServerDelegateMBean attributes
are read-only.
// Now we will always fail:
// Either because the attribute is null or because it is not
// accessible (or does not exist).
//
final String attname = (attribute==null?null:attribute.getName());
if (attname == null) {
final RuntimeException r =
new IllegalArgumentException("Attribute name cannot be null");
throw new RuntimeOperationsException(r,
"Exception occurred trying to invoke the setter on the MBean");
}
// This is a hack: we call getAttribute in order to generate an
// AttributeNotFoundException if the attribute does not exist.
//
Object val = getAttribute(attname);
// If we reach this point, we know that the requested attribute
// exists. However, since all attributes are read-only, we throw
// an AttributeNotFoundException.
//
throw new AttributeNotFoundException(attname + " not accessible");
|
public javax.management.AttributeList | setAttributes(javax.management.AttributeList attributes)This method always return an empty list since all
MBeanServerDelegateMBean attributes are read-only.
return new AttributeList(0);
|
private static final void | trace(java.lang.String clz, java.lang.String func, java.lang.String info)
Trace.send(Trace.LEVEL_TRACE, Trace.INFO_MBEANSERVER, clz, func, info);
|
private static final void | trace(java.lang.String func, java.lang.String info)
trace(dbgTag, func, info);
|