org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties.getBasePath()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(263)

本文整理了Java中org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties.getBasePath()方法的一些代码示例,展示了WebEndpointProperties.getBasePath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebEndpointProperties.getBasePath()方法的具体详情如下:
包路径:org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
类名称:WebEndpointProperties
方法名:getBasePath

WebEndpointProperties.getBasePath介绍

暂无

代码示例

代码示例来源:origin: codecentric/spring-boot-admin

  1. protected String getEndpointsWebPath() {
  2. return webEndpoint.getBasePath();
  3. }

代码示例来源:origin: spring-cloud/spring-cloud-sleuth

  1. /**
  2. * Uses {@link ServerProperties#getServlet()#getContextPath()} and
  3. * {@link WebEndpointProperties#getBasePath()} to skip Actuator endpoints.
  4. */
  5. static Optional<Pattern> getPatternForServerProperties(
  6. ServerProperties serverProperties,
  7. WebEndpointProperties webEndpointProperties) {
  8. String contextPath = serverProperties.getServlet().getContextPath();
  9. if (StringUtils.hasText(contextPath)) {
  10. return Optional.of(Pattern.compile(
  11. contextPath + webEndpointProperties.getBasePath() + ".*"));
  12. }
  13. return Optional.empty();
  14. }

代码示例来源:origin: de.codecentric/spring-boot-admin-client

  1. protected String getEndpointsWebPath() {
  2. return webEndpoint.getBasePath();
  3. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. private ServerWebExchangeMatcher createDelegate(
  2. WebEndpointProperties properties) {
  3. if (StringUtils.hasText(properties.getBasePath())) {
  4. return new PathPatternParserServerWebExchangeMatcher(
  5. properties.getBasePath());
  6. }
  7. return EMPTY_MATCHER;
  8. }

代码示例来源:origin: org.flowable/flowable-ui-common

  1. protected RequestMatcher createDelegate(WebApplicationContext context, RequestMatcherFactory requestMatcherFactory) {
  2. WebEndpointProperties properties = context.getBean(WebEndpointProperties.class);
  3. if (StringUtils.hasText(properties.getBasePath())) {
  4. return requestMatcherFactory.antPath(properties.getBasePath() + "/**");
  5. }
  6. return EMPTY_MATCHER;
  7. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. @ConditionalOnMissingBean
  3. public PathMappedEndpoints pathMappedEndpoints(
  4. Collection<EndpointsSupplier<?>> endpointSuppliers,
  5. WebEndpointProperties webEndpointProperties) {
  6. return new PathMappedEndpoints(webEndpointProperties.getBasePath(),
  7. endpointSuppliers);
  8. }

代码示例来源:origin: net.guerlab/guerlab-spring-commons

  1. @Autowired
  2. public void advisor(WebEndpointProperties webEndpointProperties,
  3. ResponseAdvisorProperties responseAdvisorProperties) {
  4. String basePath = webEndpointProperties.getBasePath();
  5. if (StringUtils.isBlank(basePath)) {
  6. return;
  7. }
  8. List<String> excluded = responseAdvisorProperties.getExcluded();
  9. List<String> list = excluded == null ? new ArrayList<>() : new ArrayList<>(excluded);
  10. list.add(basePath);
  11. responseAdvisorProperties.setExcluded(list);
  12. }
  13. }

代码示例来源:origin: otto-de/edison-microservice

  1. @ModelAttribute
  2. public void addAttributes(Model model) {
  3. model.addAttribute("webEndpointBasePath", webEndpointProperties.getBasePath());
  4. model.addAttribute("edisonManagementBasePath", edisonApplicationProperties.getManagement().getBasePath());
  5. }

代码示例来源:origin: net.guerlab.spring/guerlab-spring-commons

  1. @Autowired
  2. public void advisor(WebEndpointProperties webEndpointProperties,
  3. ResponseAdvisorProperties responseAdvisorProperties) {
  4. String basePath = webEndpointProperties.getBasePath();
  5. if (StringUtils.isBlank(basePath)) {
  6. return;
  7. }
  8. List<String> excluded = responseAdvisorProperties.getExcluded();
  9. List<String> list = excluded == null ? new ArrayList<>() : new ArrayList<>(excluded);
  10. list.add(basePath);
  11. responseAdvisorProperties.setExcluded(list);
  12. }
  13. }

代码示例来源:origin: org.springframework.cloud/spring-cloud-sleuth-core

  1. /**
  2. * Uses {@link ServerProperties#getServlet()#getContextPath()} and
  3. * {@link WebEndpointProperties#getBasePath()} to skip Actuator endpoints.
  4. */
  5. static Optional<Pattern> getPatternForServerProperties(
  6. ServerProperties serverProperties,
  7. WebEndpointProperties webEndpointProperties) {
  8. String contextPath = serverProperties.getServlet().getContextPath();
  9. if (StringUtils.hasText(contextPath)) {
  10. return Optional.of(Pattern.compile(
  11. contextPath + webEndpointProperties.getBasePath() + ".*"));
  12. }
  13. return Optional.empty();
  14. }

代码示例来源:origin: io.hawt/hawtio-springboot

  1. public String resolve(final String endpointName) {
  2. final Map<String, String> pathMapping = webEndpointProperties.getPathMapping();
  3. final String basePath = webEndpointProperties.getBasePath();
  4. final String servletPath = dispatcherServletPath.getPath();
  5. String endpointPathMapping = pathMapping.get(endpointName);
  6. if (endpointPathMapping == null) {
  7. endpointPathMapping = endpointName;
  8. }
  9. final String webContextPath = Strings.webContextPath(servletPath, basePath, endpointPathMapping);
  10. return webContextPath.isEmpty() ? "/" : webContextPath;
  11. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. public ServletEndpointRegistrar servletEndpointRegistrar(
  3. WebEndpointProperties properties,
  4. ServletEndpointsSupplier servletEndpointsSupplier) {
  5. JerseyApplicationPath jerseyApplicationPath = this.context
  6. .getBean(JerseyApplicationPath.class);
  7. return new ServletEndpointRegistrar(
  8. jerseyApplicationPath.getRelativePath(properties.getBasePath()),
  9. servletEndpointsSupplier.getEndpoints());
  10. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. public ServletEndpointRegistrar servletEndpointRegistrar(
  3. WebEndpointProperties properties,
  4. ServletEndpointsSupplier servletEndpointsSupplier) {
  5. DispatcherServletPath dispatcherServletPath = this.context
  6. .getBean(DispatcherServletPath.class);
  7. return new ServletEndpointRegistrar(
  8. dispatcherServletPath.getRelativePath(properties.getBasePath()),
  9. servletEndpointsSupplier.getEndpoints());
  10. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Override
  2. protected RequestMatcher createDelegate(WebApplicationContext context,
  3. RequestMatcherFactory requestMatcherFactory) {
  4. WebEndpointProperties properties = context
  5. .getBean(WebEndpointProperties.class);
  6. String basePath = properties.getBasePath();
  7. if (StringUtils.hasText(basePath)) {
  8. return new OrRequestMatcher(getLinksMatchers(requestMatcherFactory,
  9. getRequestMatcherProvider(context), basePath));
  10. }
  11. return EMPTY_MATCHER;
  12. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. @ConditionalOnMissingBean
  3. public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
  4. ControllerEndpointsSupplier controllerEndpointsSupplier,
  5. CorsEndpointProperties corsProperties,
  6. WebEndpointProperties webEndpointProperties) {
  7. EndpointMapping endpointMapping = new EndpointMapping(
  8. webEndpointProperties.getBasePath());
  9. return new ControllerEndpointHandlerMapping(endpointMapping,
  10. controllerEndpointsSupplier.getEndpoints(),
  11. corsProperties.toCorsConfiguration());
  12. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. @ConditionalOnMissingBean
  3. public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
  4. ControllerEndpointsSupplier controllerEndpointsSupplier,
  5. CorsEndpointProperties corsProperties,
  6. WebEndpointProperties webEndpointProperties) {
  7. EndpointMapping endpointMapping = new EndpointMapping(
  8. webEndpointProperties.getBasePath());
  9. return new ControllerEndpointHandlerMapping(endpointMapping,
  10. controllerEndpointsSupplier.getEndpoints(),
  11. corsProperties.toCorsConfiguration());
  12. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. @ConditionalOnMissingBean
  3. public WebFluxEndpointHandlerMapping webEndpointReactiveHandlerMapping(
  4. WebEndpointsSupplier webEndpointsSupplier,
  5. ControllerEndpointsSupplier controllerEndpointsSupplier,
  6. EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
  7. WebEndpointProperties webEndpointProperties) {
  8. EndpointMapping endpointMapping = new EndpointMapping(
  9. webEndpointProperties.getBasePath());
  10. Collection<ExposableWebEndpoint> endpoints = webEndpointsSupplier.getEndpoints();
  11. List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
  12. allEndpoints.addAll(endpoints);
  13. allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
  14. return new WebFluxEndpointHandlerMapping(endpointMapping, endpoints,
  15. endpointMediaTypes, corsProperties.toCorsConfiguration(),
  16. new EndpointLinksResolver(allEndpoints,
  17. webEndpointProperties.getBasePath()));
  18. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. @ConditionalOnMissingBean
  3. public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(
  4. WebEndpointsSupplier webEndpointsSupplier,
  5. ServletEndpointsSupplier servletEndpointsSupplier,
  6. ControllerEndpointsSupplier controllerEndpointsSupplier,
  7. EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
  8. WebEndpointProperties webEndpointProperties) {
  9. List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
  10. Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier
  11. .getEndpoints();
  12. allEndpoints.addAll(webEndpoints);
  13. allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
  14. allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
  15. EndpointMapping endpointMapping = new EndpointMapping(
  16. webEndpointProperties.getBasePath());
  17. return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints,
  18. endpointMediaTypes, corsProperties.toCorsConfiguration(),
  19. new EndpointLinksResolver(allEndpoints,
  20. webEndpointProperties.getBasePath()));
  21. }

代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure

  1. @Bean
  2. public ResourceConfigCustomizer webEndpointRegistrar(
  3. WebEndpointsSupplier webEndpointsSupplier,
  4. ServletEndpointsSupplier servletEndpointsSupplier,
  5. EndpointMediaTypes endpointMediaTypes,
  6. WebEndpointProperties webEndpointProperties) {
  7. List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
  8. allEndpoints.addAll(webEndpointsSupplier.getEndpoints());
  9. allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
  10. return (resourceConfig) -> {
  11. JerseyEndpointResourceFactory resourceFactory = new JerseyEndpointResourceFactory();
  12. String basePath = webEndpointProperties.getBasePath();
  13. EndpointMapping endpointMapping = new EndpointMapping(basePath);
  14. Collection<ExposableWebEndpoint> webEndpoints = Collections
  15. .unmodifiableCollection(webEndpointsSupplier.getEndpoints());
  16. resourceConfig.registerResources(
  17. new HashSet<>(resourceFactory.createEndpointResources(endpointMapping,
  18. webEndpoints, endpointMediaTypes,
  19. new EndpointLinksResolver(allEndpoints, basePath))));
  20. };
  21. }

代码示例来源:origin: org.tuxdevelop/spring-batch-lightmin-client-core

  1. this.append(this.getServiceUrl(),
  2. this.managementServerProperties.getServlet().getContextPath()),
  3. this.webEndpointProperties.getBasePath());
  4. } else {
  5. if (this.managementPort == null) {
  6. this.append(this.createLocalUri(hostAddress, this.managementPort),
  7. this.managementServerProperties.getServlet().getContextPath()),
  8. this.webEndpointProperties.getBasePath());
  9. this.append(this.createLocalUri(this.determineHost(), this.managementPort),
  10. this.managementServerProperties.getServlet().getContextPath()),
  11. this.webEndpointProperties.getBasePath());

相关文章