• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MvcEndpoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint的典型用法代码示例。如果您正苦于以下问题:Java MvcEndpoint类的具体用法?Java MvcEndpoint怎么用?Java MvcEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MvcEndpoint类属于org.springframework.boot.actuate.endpoint.mvc包,在下文中一共展示了MvcEndpoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:17,代码来源:ManagementWebSecurityAutoConfiguration.java


示例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);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:8,代码来源:CasReportsConfiguration.java


示例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);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:8,代码来源:CasReportsConfiguration.java


示例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);
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:9,代码来源:EndpointWebMvcAutoConfigurationTests.java


示例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


示例16: 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).size(),
			is(equalTo(4)));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:EndpointWebMvcAutoConfigurationTests.java


示例17: 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).size(),
			is(equalTo(0)));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:EndpointWebMvcAutoConfigurationTests.java


示例18: 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).size(), is(equalTo(0)));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:EndpointWebMvcAutoConfigurationTests.java


示例19: 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).size(), is(equalTo(1)));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:EndpointWebMvcAutoConfigurationTests.java


示例20: 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;
		this.mockMvc.perform(get("/actuator").accept(MediaType.APPLICATION_JSON))
				.andExpect(status().isOk())
				.andExpect(jsonPath("$._links.%s.href", path).exists());
	}
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:14,代码来源:VanillaHypermediaIntegrationTests.java



注:本文中的org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ChildAttributes类代码示例发布时间:2022-05-22
下一篇:
Java InternalBindingValue类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap