use of org.apache.felix.mosgi.jmx.agent.mx4j.log.Logger in project felix by apache.
the class InvokerMBeanServerInterceptor method getAttributes.
public AttributeList getAttributes(MBeanMetaData metadata, String[] attributes) {
if (metadata.dynamic) {
try {
return ((DynamicMBean) metadata.mbean).getAttributes(attributes);
} catch (JMRuntimeException x) {
throw x;
} catch (RuntimeException x) {
throw new RuntimeMBeanException(x);
} catch (Error x) {
throw new RuntimeErrorException(x);
}
} else {
AttributeList list = new AttributeList();
for (int i = 0; i < attributes.length; ++i) {
String name = attributes[i];
try {
Object value = getAttribute(metadata, name);
Attribute attr = new Attribute(name, value);
list.add(attr);
} catch (Exception ignored) {
Logger logger = getLogger();
if (logger.isEnabledFor(Logger.DEBUG))
logger.debug("Exception caught from getAttributes(), ignoring attribute " + name);
}
}
return list;
}
}
use of org.apache.felix.mosgi.jmx.agent.mx4j.log.Logger in project felix by apache.
the class InvokerMBeanServerInterceptor method setAttributes.
public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes) {
if (metadata.dynamic) {
try {
return ((DynamicMBean) metadata.mbean).setAttributes(attributes);
} catch (JMRuntimeException x) {
throw x;
} catch (RuntimeException x) {
throw new RuntimeMBeanException(x);
} catch (Error x) {
throw new RuntimeErrorException(x);
}
} else {
AttributeList list = new AttributeList();
for (int i = 0; i < attributes.size(); ++i) {
Attribute attr = (Attribute) attributes.get(i);
try {
setAttribute(metadata, attr);
list.add(attr);
} catch (Exception ignored) {
Logger logger = getLogger();
if (logger.isEnabledFor(Logger.DEBUG))
logger.debug("Exception caught from setAttributes(), ignoring attribute " + attr, ignored);
}
}
return list;
}
}
use of org.apache.felix.mosgi.jmx.agent.mx4j.log.Logger in project felix by apache.
the class MBeanIntrospector method getDynamicMBeanInfo.
private MBeanInfo getDynamicMBeanInfo(MBeanMetaData metadata) {
Logger logger = getLogger();
MBeanInfo info = null;
try {
info = ((DynamicMBean) metadata.mbean).getMBeanInfo();
} catch (Exception x) {
if (logger.isEnabledFor(Logger.DEBUG))
logger.debug("getMBeanInfo threw: " + x.toString());
}
if (logger.isEnabledFor(Logger.TRACE))
logger.trace("Dynamic MBeanInfo is: " + info);
if (info == null) {
if (logger.isEnabledFor(Logger.DEBUG))
logger.debug("MBeanInfo cannot be null");
return null;
}
return info;
}
Aggregations