Search in sources :

Example 1 with Operation

use of org.apache.activemq.artemis.api.core.management.Operation in project activemq-artemis by apache.

the class MBeanInfoHelper method getOperationInfo.

private static MBeanOperationInfo getOperationInfo(final Method operation) {
    MBeanOperationInfo info = null;
    Class<?> returnType = operation.getReturnType();
    MBeanParameterInfo[] paramsInfo = MBeanInfoHelper.getParametersInfo(operation.getParameterAnnotations(), operation.getParameterTypes());
    String description = operation.getName();
    int impact = MBeanOperationInfo.UNKNOWN;
    if (operation.getAnnotation(Operation.class) != null) {
        description = operation.getAnnotation(Operation.class).desc();
        impact = operation.getAnnotation(Operation.class).impact();
    }
    info = new MBeanOperationInfo(operation.getName(), description, paramsInfo, returnType.getName(), impact);
    return info;
}
Also used : MBeanOperationInfo(javax.management.MBeanOperationInfo) Operation(org.apache.activemq.artemis.api.core.management.Operation) MBeanParameterInfo(javax.management.MBeanParameterInfo)

Aggregations

MBeanOperationInfo (javax.management.MBeanOperationInfo)1 MBeanParameterInfo (javax.management.MBeanParameterInfo)1 Operation (org.apache.activemq.artemis.api.core.management.Operation)1