本文整理汇总了Java中org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint类的典型用法代码示例。如果您正苦于以下问题:Java MvcEndpoint类的具体用法?Java MvcEndpoint怎么用?Java MvcEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MvcEndpoint类属于org.springframework.boot.actuate.endpoint.mvc包,在下文中一共展示了MvcEndpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaths
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
public String[] getPaths(EndpointHandlerMapping endpointHandlerMapping) {
if (endpointHandlerMapping == null) {
return NO_PATHS;
}
Set<? extends MvcEndpoint> endpoints = endpointHandlerMapping.getEndpoints();
Set<String> paths = new LinkedHashSet<String>(endpoints.size());
for (MvcEndpoint endpoint : endpoints) {
if (isIncluded(endpoint)) {
String path = endpointHandlerMapping.getPath(endpoint.getPath());
paths.add(path);
if (!path.equals("")) {
if (endpoint.isSensitive()) {
// Ensure that nested paths are secured
paths.add(path + "/**");
// Add Spring MVC-generated additional paths
paths.add(path + ".*");
}
}
paths.add(path + "/");
}
}
return paths.toArray(new String[paths.size()]);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:ManagementWebSecurityAutoConfiguration.java
示例2: endpointHandlerMapping
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public EndpointHandlerMapping endpointHandlerMapping() {
Set<? extends MvcEndpoint> endpoints = mvcEndpoints().getEndpoints();
CorsConfiguration corsConfiguration = getCorsConfiguration(this.corsProperties);
EndpointHandlerMapping mapping = new EndpointHandlerMapping(endpoints,
corsConfiguration);
boolean disabled = this.managementServerProperties.getPort() != null
&& this.managementServerProperties.getPort() == -1;
mapping.setDisabled(disabled);
if (!disabled) {
mapping.setPrefix(this.managementServerProperties.getContextPath());
}
if (this.mappingCustomizers != null) {
for (EndpointHandlerMappingCustomizer customizer : this.mappingCustomizers) {
customizer.customize(mapping);
}
}
return mapping;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:21,代码来源:EndpointWebMvcManagementContextConfiguration.java
示例3: getRequiredEndpointHandlerMapping
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
protected final EndpointHandlerMapping getRequiredEndpointHandlerMapping() {
if (this.endpointHandlerMapping == null) {
ApplicationContext context = (this.contextResolver == null ? null
: this.contextResolver.getApplicationContext());
if (context != null && context
.getBeanNamesForType(EndpointHandlerMapping.class).length > 0) {
this.endpointHandlerMapping = context
.getBean(EndpointHandlerMapping.class);
}
if (this.endpointHandlerMapping == null) {
this.endpointHandlerMapping = new EndpointHandlerMapping(
Collections.<MvcEndpoint>emptySet());
}
}
return this.endpointHandlerMapping;
}
示例4: internalConfigController
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Profile("standalone")
@ConditionalOnBean(name = "configurationPropertiesEnvironmentManager")
@Bean
@RefreshScope
public MvcEndpoint internalConfigController() {
return new ConfigurationStateController(casProperties);
}
示例5: statisticsController
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Autowired
@Bean
@RefreshScope
public MvcEndpoint statisticsController(@Qualifier("auditTrailManager") final DelegatingAuditTrailManager auditTrailManager) {
return new StatisticsController(auditTrailManager, centralAuthenticationService,
metricsRegistry, healthCheckRegistry, casProperties);
}
示例6: addEndpointLinks
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
public void addEndpointLinks(ResourceSupport resource, String self) {
if (!resource.hasLink("self")) {
resource.add(linkTo(LinksEnhancer.class).slash(this.rootPath + self)
.withSelfRel());
}
Set<String> added = new HashSet<String>();
for (MvcEndpoint endpoint : this.endpoints.getEndpoints()) {
if (!endpoint.getPath().equals(self) && !added.contains(endpoint.getPath())) {
addEndpointLink(resource, endpoint);
}
added.add(endpoint.getPath());
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:LinksEnhancer.java
示例7: addEndpointLink
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
private void addEndpointLink(ResourceSupport resource, MvcEndpoint endpoint) {
Class<?> type = endpoint.getEndpointType();
type = (type == null ? Object.class : type);
String path = endpoint.getPath();
String rel = (path.startsWith("/") ? path.substring(1) : path);
if (StringUtils.hasText(rel)) {
String fullPath = this.rootPath + endpoint.getPath();
resource.add(linkTo(type).slash(fullPath).withRel(rel));
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:LinksEnhancer.java
示例8: endpointsDefaultConfiguration
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Test
public void endpointsDefaultConfiguration() throws Exception {
this.applicationContext.register(RootConfig.class, BaseConfiguration.class,
ServerPortConfig.class, EndpointWebMvcAutoConfiguration.class);
this.applicationContext.refresh();
// /health, /metrics, /env, /actuator, /heapdump (/shutdown is disabled by default)
assertThat(this.applicationContext.getBeansOfType(MvcEndpoint.class)).hasSize(5);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:EndpointWebMvcAutoConfigurationTests.java
示例9: endpointsAllDisabled
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Test
public void endpointsAllDisabled() throws Exception {
this.applicationContext.register(RootConfig.class, BaseConfiguration.class,
ServerPortConfig.class, EndpointWebMvcAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.applicationContext,
"ENDPOINTS_ENABLED:false");
this.applicationContext.refresh();
assertThat(this.applicationContext.getBeansOfType(MvcEndpoint.class)).isEmpty();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:EndpointWebMvcAutoConfigurationTests.java
示例10: endpointDisabled
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
private void endpointDisabled(String name, Class<? extends MvcEndpoint> type) {
this.applicationContext.register(RootConfig.class, BaseConfiguration.class,
ServerPortConfig.class, EndpointWebMvcAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.applicationContext,
String.format("endpoints.%s.enabled:false", name));
this.applicationContext.refresh();
assertThat(this.applicationContext.getBeansOfType(type)).isEmpty();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:EndpointWebMvcAutoConfigurationTests.java
示例11: endpointEnabledOverride
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
private void endpointEnabledOverride(String name, Class<? extends MvcEndpoint> type)
throws Exception {
this.applicationContext.register(RootConfig.class, BaseConfiguration.class,
ServerPortConfig.class, EndpointWebMvcAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.applicationContext,
"endpoints.enabled:false",
String.format("endpoints_%s_enabled:true", name));
this.applicationContext.refresh();
assertThat(this.applicationContext.getBeansOfType(type)).hasSize(1);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:EndpointWebMvcAutoConfigurationTests.java
示例12: getConfiguredPath
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
private String getConfiguredPath() {
if (MvcEndpoint.class.isAssignableFrom(this.endpointClass)) {
return ((MvcEndpoint) this.context.getBean(this.endpointClass)).getPath();
}
for (MvcEndpoint endpoint : this.context.getBean(MvcEndpoints.class)
.getEndpoints()) {
if (endpoint instanceof EndpointMvcAdapter && this.endpointClass
.isInstance(((EndpointMvcAdapter) endpoint).getDelegate())) {
return ((EndpointMvcAdapter) endpoint).getPath();
}
}
throw new IllegalStateException(
"Could not get configured path for " + this.endpointClass);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:MvcEndpointPathConfigurationTests.java
示例13: getEndpoints
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
private Collection<? extends MvcEndpoint> getEndpoints() {
List<? extends MvcEndpoint> endpoints = new ArrayList<MvcEndpoint>(
this.mvcEndpoints.getEndpoints());
Collections.sort(endpoints, new Comparator<MvcEndpoint>() {
@Override
public int compare(MvcEndpoint o1, MvcEndpoint o2) {
return o1.getPath().compareTo(o2.getPath());
}
});
return endpoints;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:EndpointDocumentation.java
示例14: endpointsDefaultConfiguration
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Test
public void endpointsDefaultConfiguration() throws Exception {
this.applicationContext.register(RootConfig.class, BaseConfiguration.class,
ServerPortConfig.class, EndpointWebMvcAutoConfiguration.class);
this.applicationContext.refresh();
// /health, /metrics, /env, /actuator (/shutdown is disabled by default)
assertThat(this.applicationContext.getBeansOfType(MvcEndpoint.class)).hasSize(4);
}
示例15: endpointsAllListed
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint; //导入依赖的package包/类
@Test
public void endpointsAllListed() throws Exception {
for (MvcEndpoint endpoint : this.mvcEndpoints.getEndpoints()) {
String path = endpoint.getPath();
if ("/actuator".equals(path)) {
continue;
}
path = path.startsWith("/") ? path.substring(1) : path;
path = path.length() > 0 ? path : "self";
this.mockMvc.perform(get("/admin").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$._links.%s.href", path)
.value("http://localhost/admin" + endpoint.getPath()));
}
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:16,代码来源:ManagementContextPathHypermediaIntegrationTests.java