Package org.springframework.boot.actuate.endpoint.mvc

Examples of org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping


  }

  @Bean
  @ConditionalOnMissingBean
  public EndpointHandlerMapping endpointHandlerMapping() {
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(mvcEndpoints()
        .getEndpoints());
    boolean disabled = ManagementServerPort.get(this.applicationContext) != ManagementServerPort.SAME;
    mapping.setDisabled(disabled);
    if (!disabled) {
      mapping.setPrefix(this.managementServerProperties.getContextPath());
    }
    return mapping;
  }
View Full Code Here


  @Bean
  public HandlerMapping handlerMapping(MvcEndpoints endpoints,
      ListableBeanFactory beanFactory) {
    Set<MvcEndpoint> set = new HashSet<MvcEndpoint>(endpoints.getEndpoints());
    set.addAll(beanFactory.getBeansOfType(MvcEndpoint.class).values());
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(set);
    // In a child context we definitely want to see the parent endpoints
    mapping.setDetectHandlerMethodsInAncestorContexts(true);
    return mapping;
  }
View Full Code Here

  }

  @Test
  public void beanMethodMappings() {
    StaticApplicationContext context = new StaticApplicationContext();
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(
        Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
    mapping.setApplicationContext(new StaticApplicationContext());
    mapping.afterPropertiesSet();
    context.getDefaultListableBeanFactory().registerSingleton("mapping", mapping);
    this.endpoint.setApplicationContext(context);
    Map<String, Object> result = this.endpoint.invoke();
    assertEquals(1, result.size());
    assertTrue(result.keySet().iterator().next().contains("/dump"));
View Full Code Here

    assertTrue(handler.containsKey("method"));
  }

  @Test
  public void concreteMethodMappings() {
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(
        Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
    mapping.setApplicationContext(new StaticApplicationContext());
    mapping.afterPropertiesSet();
    this.endpoint.setMethodMappings(Collections
        .<AbstractHandlerMethodMapping<?>> singletonList(mapping));
    Map<String, Object> result = this.endpoint.invoke();
    assertEquals(1, result.size());
    assertTrue(result.keySet().iterator().next().contains("/dump"));
View Full Code Here

TOP

Related Classes of org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.