本文整理了Java中org.fabric3.api.annotation.management.ManagementOperation.description()
方法的一些代码示例,展示了ManagementOperation.description()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ManagementOperation.description()
方法的具体详情如下:
包路径:org.fabric3.api.annotation.management.ManagementOperation
类名称:ManagementOperation
方法名:description
暂无
代码示例来源:origin: com.carecon.fabric3/fabric3-management-jmx
private void introspect(Object instance, ManagementInfo info) {
for (Method method : instance.getClass().getMethods()) {
ManagementOperation annotation = method.getAnnotation(ManagementOperation.class);
if (annotation == null) {
continue;
}
String description = annotation.description();
if (description.trim().length() == 0) {
description = null;
}
String[] roleNames = annotation.rolesAllowed();
Set<Role> roles = new HashSet<>();
for (String name : roleNames) {
roles.add(new Role(name));
}
String path = annotation.path();
ManagementOperationInfo operationInfo = new ManagementOperationInfo(method, path, OperationType.UNDEFINED, description, roles);
info.addOperation(operationInfo);
}
}
代码示例来源:origin: org.codehaus.fabric3/fabric3-management-jmx
private void introspect(Object instance, ManagementInfo info) {
for (Method method : instance.getClass().getMethods()) {
ManagementOperation annotation = method.getAnnotation(ManagementOperation.class);
if (annotation == null) {
continue;
}
String description = annotation.description();
if (description.trim().length() == 0) {
description = null;
}
Signature signature = new Signature(method);
String[] roleNames = annotation.rolesAllowed();
Set<Role> roles = new HashSet<Role>();
for (String name : roleNames) {
roles.add(new Role(name));
}
String path = annotation.path();
ManagementOperationInfo operationInfo = new ManagementOperationInfo(signature, path, OperationType.UNDEFINED, description, roles);
info.addOperation(operationInfo);
}
}
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!