org.fabric3.api.annotation.management.ManagementOperation.type()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.fabric3.api.annotation.management.ManagementOperation.type()方法的一些代码示例,展示了ManagementOperation.type()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ManagementOperation.type()方法的具体详情如下:
包路径:org.fabric3.api.annotation.management.ManagementOperation
类名称:ManagementOperation
方法名:type

ManagementOperation.type介绍

暂无

代码示例

代码示例来源:origin: com.carecon.fabric3/fabric3-introspection-java

public void visitMethod(ManagementOperation annotation,
            Method method,
            Class<?> implClass,
            InjectingComponentType componentType,
            IntrospectionContext context) {
  ManagementInfo info = componentType.getManagementInfo();
  if (info == null) {
    // there was no management annotation on the type - record an error
    Class<?> clazz = method.getDeclaringClass();
    String name = Management.class.getSimpleName();
    context.addError(new InvalidAnnotation("Implementation is missing @" + name, method, annotation, clazz));
    return;
  }
  String description = annotation.description();
  if (description.trim().length() == 0) {
    description = null;
  }
  Set<Role> roles = new HashSet<>();
  for (String roleName : annotation.rolesAllowed()) {
    roles.add(new Role(roleName));
  }
  String path = annotation.path();
  org.fabric3.api.annotation.management.OperationType operationType = annotation.type();
  OperationType type = OperationType.valueOf(operationType.toString());
  ManagementOperationInfo operationInfo = new ManagementOperationInfo(method, path, type, description, roles);
  info.addOperation(operationInfo);
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-introspection-java

public void visitMethod(ManagementOperation annotation,
            Method method,
            Class<?> implClass,
            InjectingComponentType componentType,
            IntrospectionContext context) {
  ManagementInfo info = componentType.getManagementInfo();
  if (info == null) {
    // there was no management annotation on the type - record an error
    Class<?> clazz = method.getDeclaringClass();
    context.addError(new InvalidAnnotation("Implementation is missing @" + Management.class.getSimpleName(), clazz));
    return;
  }
  String description = annotation.description();
  if (description.trim().length() == 0) {
    description = null;
  }
  Signature signature = new Signature(method);
  Set<Role> roles = new HashSet<Role>();
  for (String roleName : annotation.rolesAllowed()) {
    roles.add(new Role(roleName));
  }
  String path = annotation.path();
  org.fabric3.api.annotation.management.OperationType operationType = annotation.type();
  OperationType type = OperationType.valueOf(operationType.toString());
  ManagementOperationInfo operationInfo = new ManagementOperationInfo(signature, path, type, description, roles);
  info.addOperation(operationInfo);
}

相关文章