Search in sources :

Example 1 with CachingOperationInvokerAdvisor

use of org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor in project spring-boot by spring-projects.

the class CloudFoundryWebEndpointDiscovererTests method load.

private void load(Function<EndpointId, Long> timeToLive, PathMapper endpointPathMapper, Class<?> configuration, Consumer<CloudFoundryWebEndpointDiscoverer> consumer) {
    try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configuration)) {
        ConversionServiceParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(DefaultConversionService.getSharedInstance());
        EndpointMediaTypes mediaTypes = new EndpointMediaTypes(Collections.singletonList("application/json"), Collections.singletonList("application/json"));
        CloudFoundryWebEndpointDiscoverer discoverer = new CloudFoundryWebEndpointDiscoverer(context, parameterMapper, mediaTypes, Collections.singletonList(endpointPathMapper), Collections.singleton(new CachingOperationInvokerAdvisor(timeToLive)), Collections.emptyList());
        consumer.accept(discoverer);
    }
}
Also used : CachingOperationInvokerAdvisor(org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ConversionServiceParameterValueMapper(org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper) EndpointMediaTypes(org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes)

Example 2 with CachingOperationInvokerAdvisor

use of org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor in project spring-boot by spring-projects.

the class WebEndpointDiscovererTests method load.

private void load(Function<EndpointId, Long> timeToLive, PathMapper endpointPathMapper, Class<?> configuration, Consumer<WebEndpointDiscoverer> consumer) {
    try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configuration)) {
        ConversionServiceParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(DefaultConversionService.getSharedInstance());
        EndpointMediaTypes mediaTypes = new EndpointMediaTypes(Collections.singletonList("application/json"), Collections.singletonList("application/json"));
        WebEndpointDiscoverer discoverer = new WebEndpointDiscoverer(context, parameterMapper, mediaTypes, Collections.singletonList(endpointPathMapper), Collections.singleton(new CachingOperationInvokerAdvisor(timeToLive)), Collections.emptyList());
        consumer.accept(discoverer);
    }
}
Also used : CachingOperationInvokerAdvisor(org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ConversionServiceParameterValueMapper(org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper) EndpointMediaTypes(org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes)

Example 3 with CachingOperationInvokerAdvisor

use of org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor in project spring-boot by spring-projects.

the class JmxEndpointDiscovererTests method load.

private void load(Class<?> configuration, Function<EndpointId, Long> timeToLive, Consumer<JmxEndpointDiscoverer> consumer) {
    try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(configuration)) {
        ConversionServiceParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(DefaultConversionService.getSharedInstance());
        JmxEndpointDiscoverer discoverer = new JmxEndpointDiscoverer(context, parameterMapper, Collections.singleton(new CachingOperationInvokerAdvisor(timeToLive)), Collections.emptyList());
        consumer.accept(discoverer);
    }
}
Also used : CachingOperationInvokerAdvisor(org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ConversionServiceParameterValueMapper(org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper)

Aggregations

ConversionServiceParameterValueMapper (org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper)3 CachingOperationInvokerAdvisor (org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor)3 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)3 EndpointMediaTypes (org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes)2