use of javax.management.AttributeNotFoundException in project Payara by payara.
the class MBeanAttributeReadHandler method getValueObject.
@Override
public JsonValue getValueObject() throws JsonException {
try {
Object attribute = delegate.getMBeanAttribute(mbeanname, attributename);
if (attribute == null) {
return JsonValue.NULL;
}
TypeProcessor<?> processor = ProcessorFactory.getTypeProcessor(attribute);
return processor.processObject(attribute);
} catch (InstanceNotFoundException | ReflectionException | MalformedObjectNameException | MBeanException | AttributeNotFoundException ex) {
super.setStatus(Response.Status.NOT_FOUND);
return getTraceObject(ex);
}
}
use of javax.management.AttributeNotFoundException in project ignite by apache.
the class ReadOnlyDynamicMBean method getAttributes.
/**
* {@inheritDoc}
*/
@Override
public AttributeList getAttributes(String[] attributes) {
AttributeList list = new AttributeList();
try {
for (String attribute : attributes) {
Object val = getAttribute(attribute);
list.add(val);
}
return list;
} catch (MBeanException | ReflectionException | AttributeNotFoundException e) {
throw new IgniteException(e);
}
}
use of javax.management.AttributeNotFoundException in project Payara by payara.
the class AbstractDynamicMBeanImpl method setAttributes.
public final AttributeList setAttributes(AttributeList attributes) {
AttributeList r = new AttributeList(attributes.size());
for (Object a : attributes) {
try {
setAttribute(Attribute.class.cast(a));
r.add(Attribute.class.cast(a));
} catch (AttributeNotFoundException e) {
// error is silently ignored
} catch (ReflectionException e) {
// error is silently ignored
} catch (MBeanException e) {
// error is silently ignored
} catch (InvalidAttributeValueException e) {
// error is silently ignored
}
}
return r;
}
use of javax.management.AttributeNotFoundException in project infrautils by opendaylight.
the class MBeanUtils method readMBeanAttribute.
@Nullable
public static Object readMBeanAttribute(String objName, String attribute) {
@Var Object attributeObj = null;
try {
ObjectName objectName = new ObjectName(objName);
MBeanServer platformMbeanServer = ManagementFactory.getPlatformMBeanServer();
attributeObj = platformMbeanServer.getAttribute(objectName, attribute);
} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException | ReflectionException | MalformedObjectNameException t) {
LOG.info("CRITICAL : Exception in executing MXBean function");
}
return attributeObj;
}
use of javax.management.AttributeNotFoundException in project infrautils by opendaylight.
the class AbstractMXBean method readMBeanAttribute.
/**
* Read an mbean attribute from the platform MBean server.
*
* @return Object if successfully executed, "" otherwise.
*/
public Object readMBeanAttribute(String attribute) {
@Var Object attributeObj = "";
try {
ObjectName objectName = this.getMBeanObjectName();
MBeanServer platformMbeanServer = ManagementFactory.getPlatformMBeanServer();
attributeObj = platformMbeanServer.getAttribute(objectName, attribute);
} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException | ReflectionException | MalformedObjectNameException e) {
LOG.info("Failed when reading MBean attribute", e);
}
return attributeObj;
}
Aggregations