@Override
public Object invoke(final String actionName, final Object[] params, final String[] signature)
throws MBeanException, ReflectionException {
if ("getAttribute".equals(actionName) && params.length == 1 && signature[0].equals(String.class.getName())) {
try {
return getAttribute((String) params[0]);
} catch (final AttributeNotFoundException e) {
throw new MBeanException(e, "Attribute not found on " + moduleIdentifier);
}
} else if ("getAttributes".equals(actionName) && params.length == 1
&& signature[0].equals(String[].class.getName())) {
return getAttributes((String[]) params[0]);
} else if ("setAttributes".equals(actionName) && params.length == 1
&& signature[0].equals(AttributeList.class.getName())) {
return setAttributes((AttributeList) params[0]);
} else {
LOG.debug("Operation not found {} ", actionName);
throw new UnsupportedOperationException(String.format(
"Operation not found on %s. Method invoke is only supported for getInstance and getAttribute(s) "
+ "method, got actionName %s, params %s, signature %s ",
moduleIdentifier, actionName, params, signature));
}
}
AbstractDynamicWrapper.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:hashsdn-controller
作者:
评论列表
文章目录