本文整理了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
暂无
代码示例来源:origin: codecentric/spring-boot-admin
protected String getEndpointsWebPath() {
return webEndpoint.getBasePath();
}
代码示例来源:origin: spring-cloud/spring-cloud-sleuth
/**
* Uses {@link ServerProperties#getServlet()#getContextPath()} and
* {@link WebEndpointProperties#getBasePath()} to skip Actuator endpoints.
*/
static Optional<Pattern> getPatternForServerProperties(
ServerProperties serverProperties,
WebEndpointProperties webEndpointProperties) {
String contextPath = serverProperties.getServlet().getContextPath();
if (StringUtils.hasText(contextPath)) {
return Optional.of(Pattern.compile(
contextPath + webEndpointProperties.getBasePath() + ".*"));
}
return Optional.empty();
}
代码示例来源:origin: de.codecentric/spring-boot-admin-client
protected String getEndpointsWebPath() {
return webEndpoint.getBasePath();
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
private ServerWebExchangeMatcher createDelegate(
WebEndpointProperties properties) {
if (StringUtils.hasText(properties.getBasePath())) {
return new PathPatternParserServerWebExchangeMatcher(
properties.getBasePath());
}
return EMPTY_MATCHER;
}
代码示例来源:origin: org.flowable/flowable-ui-common
protected RequestMatcher createDelegate(WebApplicationContext context, RequestMatcherFactory requestMatcherFactory) {
WebEndpointProperties properties = context.getBean(WebEndpointProperties.class);
if (StringUtils.hasText(properties.getBasePath())) {
return requestMatcherFactory.antPath(properties.getBasePath() + "/**");
}
return EMPTY_MATCHER;
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
@ConditionalOnMissingBean
public PathMappedEndpoints pathMappedEndpoints(
Collection<EndpointsSupplier<?>> endpointSuppliers,
WebEndpointProperties webEndpointProperties) {
return new PathMappedEndpoints(webEndpointProperties.getBasePath(),
endpointSuppliers);
}
代码示例来源:origin: net.guerlab/guerlab-spring-commons
@Autowired
public void advisor(WebEndpointProperties webEndpointProperties,
ResponseAdvisorProperties responseAdvisorProperties) {
String basePath = webEndpointProperties.getBasePath();
if (StringUtils.isBlank(basePath)) {
return;
}
List<String> excluded = responseAdvisorProperties.getExcluded();
List<String> list = excluded == null ? new ArrayList<>() : new ArrayList<>(excluded);
list.add(basePath);
responseAdvisorProperties.setExcluded(list);
}
}
代码示例来源:origin: otto-de/edison-microservice
@ModelAttribute
public void addAttributes(Model model) {
model.addAttribute("webEndpointBasePath", webEndpointProperties.getBasePath());
model.addAttribute("edisonManagementBasePath", edisonApplicationProperties.getManagement().getBasePath());
}
代码示例来源:origin: net.guerlab.spring/guerlab-spring-commons
@Autowired
public void advisor(WebEndpointProperties webEndpointProperties,
ResponseAdvisorProperties responseAdvisorProperties) {
String basePath = webEndpointProperties.getBasePath();
if (StringUtils.isBlank(basePath)) {
return;
}
List<String> excluded = responseAdvisorProperties.getExcluded();
List<String> list = excluded == null ? new ArrayList<>() : new ArrayList<>(excluded);
list.add(basePath);
responseAdvisorProperties.setExcluded(list);
}
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-sleuth-core
/**
* Uses {@link ServerProperties#getServlet()#getContextPath()} and
* {@link WebEndpointProperties#getBasePath()} to skip Actuator endpoints.
*/
static Optional<Pattern> getPatternForServerProperties(
ServerProperties serverProperties,
WebEndpointProperties webEndpointProperties) {
String contextPath = serverProperties.getServlet().getContextPath();
if (StringUtils.hasText(contextPath)) {
return Optional.of(Pattern.compile(
contextPath + webEndpointProperties.getBasePath() + ".*"));
}
return Optional.empty();
}
代码示例来源:origin: io.hawt/hawtio-springboot
public String resolve(final String endpointName) {
final Map<String, String> pathMapping = webEndpointProperties.getPathMapping();
final String basePath = webEndpointProperties.getBasePath();
final String servletPath = dispatcherServletPath.getPath();
String endpointPathMapping = pathMapping.get(endpointName);
if (endpointPathMapping == null) {
endpointPathMapping = endpointName;
}
final String webContextPath = Strings.webContextPath(servletPath, basePath, endpointPathMapping);
return webContextPath.isEmpty() ? "/" : webContextPath;
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
public ServletEndpointRegistrar servletEndpointRegistrar(
WebEndpointProperties properties,
ServletEndpointsSupplier servletEndpointsSupplier) {
JerseyApplicationPath jerseyApplicationPath = this.context
.getBean(JerseyApplicationPath.class);
return new ServletEndpointRegistrar(
jerseyApplicationPath.getRelativePath(properties.getBasePath()),
servletEndpointsSupplier.getEndpoints());
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
public ServletEndpointRegistrar servletEndpointRegistrar(
WebEndpointProperties properties,
ServletEndpointsSupplier servletEndpointsSupplier) {
DispatcherServletPath dispatcherServletPath = this.context
.getBean(DispatcherServletPath.class);
return new ServletEndpointRegistrar(
dispatcherServletPath.getRelativePath(properties.getBasePath()),
servletEndpointsSupplier.getEndpoints());
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Override
protected RequestMatcher createDelegate(WebApplicationContext context,
RequestMatcherFactory requestMatcherFactory) {
WebEndpointProperties properties = context
.getBean(WebEndpointProperties.class);
String basePath = properties.getBasePath();
if (StringUtils.hasText(basePath)) {
return new OrRequestMatcher(getLinksMatchers(requestMatcherFactory,
getRequestMatcherProvider(context), basePath));
}
return EMPTY_MATCHER;
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
@ConditionalOnMissingBean
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
ControllerEndpointsSupplier controllerEndpointsSupplier,
CorsEndpointProperties corsProperties,
WebEndpointProperties webEndpointProperties) {
EndpointMapping endpointMapping = new EndpointMapping(
webEndpointProperties.getBasePath());
return new ControllerEndpointHandlerMapping(endpointMapping,
controllerEndpointsSupplier.getEndpoints(),
corsProperties.toCorsConfiguration());
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
@ConditionalOnMissingBean
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
ControllerEndpointsSupplier controllerEndpointsSupplier,
CorsEndpointProperties corsProperties,
WebEndpointProperties webEndpointProperties) {
EndpointMapping endpointMapping = new EndpointMapping(
webEndpointProperties.getBasePath());
return new ControllerEndpointHandlerMapping(endpointMapping,
controllerEndpointsSupplier.getEndpoints(),
corsProperties.toCorsConfiguration());
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
@ConditionalOnMissingBean
public WebFluxEndpointHandlerMapping webEndpointReactiveHandlerMapping(
WebEndpointsSupplier webEndpointsSupplier,
ControllerEndpointsSupplier controllerEndpointsSupplier,
EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
WebEndpointProperties webEndpointProperties) {
EndpointMapping endpointMapping = new EndpointMapping(
webEndpointProperties.getBasePath());
Collection<ExposableWebEndpoint> endpoints = webEndpointsSupplier.getEndpoints();
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
allEndpoints.addAll(endpoints);
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
return new WebFluxEndpointHandlerMapping(endpointMapping, endpoints,
endpointMediaTypes, corsProperties.toCorsConfiguration(),
new EndpointLinksResolver(allEndpoints,
webEndpointProperties.getBasePath()));
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
@ConditionalOnMissingBean
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(
WebEndpointsSupplier webEndpointsSupplier,
ServletEndpointsSupplier servletEndpointsSupplier,
ControllerEndpointsSupplier controllerEndpointsSupplier,
EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
WebEndpointProperties webEndpointProperties) {
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier
.getEndpoints();
allEndpoints.addAll(webEndpoints);
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
EndpointMapping endpointMapping = new EndpointMapping(
webEndpointProperties.getBasePath());
return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints,
endpointMediaTypes, corsProperties.toCorsConfiguration(),
new EndpointLinksResolver(allEndpoints,
webEndpointProperties.getBasePath()));
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Bean
public ResourceConfigCustomizer webEndpointRegistrar(
WebEndpointsSupplier webEndpointsSupplier,
ServletEndpointsSupplier servletEndpointsSupplier,
EndpointMediaTypes endpointMediaTypes,
WebEndpointProperties webEndpointProperties) {
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
allEndpoints.addAll(webEndpointsSupplier.getEndpoints());
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
return (resourceConfig) -> {
JerseyEndpointResourceFactory resourceFactory = new JerseyEndpointResourceFactory();
String basePath = webEndpointProperties.getBasePath();
EndpointMapping endpointMapping = new EndpointMapping(basePath);
Collection<ExposableWebEndpoint> webEndpoints = Collections
.unmodifiableCollection(webEndpointsSupplier.getEndpoints());
resourceConfig.registerResources(
new HashSet<>(resourceFactory.createEndpointResources(endpointMapping,
webEndpoints, endpointMediaTypes,
new EndpointLinksResolver(allEndpoints, basePath))));
};
}
代码示例来源:origin: org.tuxdevelop/spring-batch-lightmin-client-core
this.append(this.getServiceUrl(),
this.managementServerProperties.getServlet().getContextPath()),
this.webEndpointProperties.getBasePath());
} else {
if (this.managementPort == null) {
this.append(this.createLocalUri(hostAddress, this.managementPort),
this.managementServerProperties.getServlet().getContextPath()),
this.webEndpointProperties.getBasePath());
this.append(this.createLocalUri(this.determineHost(), this.managementPort),
this.managementServerProperties.getServlet().getContextPath()),
this.webEndpointProperties.getBasePath());
内容来源于网络,如有侵权,请联系作者删除!