类org.springframework.boot.actuate.endpoint.annotation.Endpoint源码实例Demo

下面列出了怎么用org.springframework.boot.actuate.endpoint.annotation.Endpoint的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: sshd-shell-spring-boot   文件: EndpointCommand.java
@Autowired
EndpointCommand(ApplicationContext appCtx) {
    appCtx.getBeansWithAnnotation(Endpoint.class).entrySet().stream()
            .sorted(Comparator.comparing(e -> e.getKey()))
            .forEachOrdered(entry -> {
                log.debug("{} : {}", entry.getKey(), entry.getValue().getClass().getName());
                for (Method m : entry.getValue().getClass().getDeclaredMethods()) {
                    if (m.isAnnotationPresent(ReadOperation.class) || m.isAnnotationPresent(WriteOperation.class)) {
                        log.debug("\tOp: {}", m.getName());
                        for (Parameter p : m.getParameters()) {
                            log.debug("\t\tParameter {}, {}", p.getName(), p.getType().getName());
                        }
                    }
                }
            });
}
 
源代码2 项目: open-cloud   文件: GatewayConfiguration.java
/**
 * 自定义网关监控端点
 *
 * @param context
 * @param bus
 * @return
 */
@Bean
@ConditionalOnEnabledEndpoint
@ConditionalOnClass({Endpoint.class})
public ApiEndpoint apiEndpoint(ApplicationContext context, BusProperties bus) {
    ApiEndpoint endpoint = new ApiEndpoint(context, bus.getId());
    log.info("ApiEndpoint [{}]", endpoint);
    return endpoint;
}
 
源代码3 项目: open-cloud   文件: ApiConfiguration.java
/**
 * 网关bus端点
 *
 * @param context
 * @param bus
 * @return
 */
@Bean
@ConditionalOnEnabledEndpoint
@ConditionalOnClass({Endpoint.class})
public ApiEndpoint apiEndpoint(ApplicationContext context, BusProperties bus) {
    ApiEndpoint endpoint = new ApiEndpoint(context, bus.getId());
    log.info("ApiEndpoint [{}]", endpoint);
    return endpoint;
}
 
 类所在包
 同包方法