类org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform源码实例Demo

下面列出了怎么用org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform的API类实例代码及写法,或者点击链接到github查看源代码。

@Bean
@ConditionalOnCloudPlatform(CloudPlatform.CLOUD_FOUNDRY)
public ApplicationInformation cloudFoundryApplicationInformation(Environment environment) {
	String uri = environment.getProperty("vcap.application.uris[0]");

	String baseUrl = UriComponentsBuilder.newInstance()
			.scheme("https")
			.host(uri)
			.build()
			.toUriString();

	return new ApplicationInformation(baseUrl);
}
 
 类方法
 同包方法