org.springframework.boot.actuate.endpoint.annotation.Endpoint Java Examples

The following examples show how to use org.springframework.boot.actuate.endpoint.annotation.Endpoint. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EndpointCommand.java    From sshd-shell-spring-boot with Apache License 2.0 6 votes vote down vote up
@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());
                        }
                    }
                }
            });
}
 
Example #2
Source File: GatewayConfiguration.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 自定义网关监控端点
 *
 * @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;
}
 
Example #3
Source File: ApiConfiguration.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 网关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;
}