当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeEnvironmentInfo类代码示例

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


RuntimeEnvironmentInfo类属于org.springframework.cloud.deployer.spi.core包,在下文中一共展示了RuntimeEnvironmentInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCreatingRuntimeEnvironmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Test
public void testCreatingRuntimeEnvironmentInfo() {
	RuntimeEnvironmentInfo rei = new RuntimeEnvironmentInfo.Builder()
			.spiClass(AppDeployer.class)
			.implementationName("TestDeployer")
			.implementationVersion("1.0.0")
			.platformClientVersion("1.2.0")
			.platformHostVersion("1.1.0")
			.platformType("Test")
			.platformApiVersion("1")
			.addPlatformSpecificInfo("foo", "bar")
			.build();
	assertThat(rei.getSpiVersion(), is(RuntimeVersionUtils.getVersion(AppDeployer.class)));
	assertThat(rei.getImplementationName(), is("TestDeployer"));
	assertThat(rei.getImplementationVersion(), is("1.0.0"));
	assertThat(rei.getPlatformType(), is("Test"));
	assertThat(rei.getPlatformApiVersion(), is("1"));
	assertThat(rei.getPlatformClientVersion(), is("1.2.0"));
	assertThat(rei.getPlatformHostVersion(), is("1.1.0"));
	assertThat(rei.getJavaVersion(), is(System.getProperty("java.version")));
	assertThat(rei.getSpringVersion(), is(SpringVersion.getVersion()));
	assertThat(rei.getSpringBootVersion(), is(RuntimeVersionUtils.getSpringBootVersion()));
	assertThat(rei.getPlatformSpecificInfo().get("foo"), is("bar"));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:25,代码来源:RuntimeEnvironmentInfoBuilderTests.java

示例2: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	String apiVersion = "v1";
	String hostVersion = "unknown";
	String frameworkId = "unknown";
	String leader = "unknown";
	try {
		GetServerInfoResponse serverInfo = marathon.getServerInfo();
		hostVersion = serverInfo.getVersion();
		frameworkId = serverInfo.getFrameworkId();
		leader = serverInfo.getLeader();
	} catch (MarathonException ignore) {}
	return new RuntimeEnvironmentInfo.Builder()
			.spiClass(AppDeployer.class)
			.implementationName(this.getClass().getSimpleName())
			.implementationVersion(RuntimeVersionUtils.getVersion(this.getClass()))
			.platformType("Mesos")
			.platformApiVersion(apiVersion)
			.platformClientVersion(RuntimeVersionUtils.getVersion(marathon.getClass()))
			.platformHostVersion(hostVersion)
			.addPlatformSpecificInfo("leader", leader)
			.addPlatformSpecificInfo("frameworkId", frameworkId)
			.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-mesos,代码行数:25,代码来源:MarathonAppDeployer.java

示例3: runtimeEnvironmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
private RuntimeEnvironmentInfo runtimeEnvironmentInfo(Class spiClass, Class implementationClass) {
	CloudFoundryClient client = connectionConfiguration.cloudFoundryClient(
		connectionConfiguration.connectionContext(connectionConfiguration.cloudFoundryConnectionProperties()),
		connectionConfiguration.tokenProvider(connectionConfiguration.cloudFoundryConnectionProperties()));
	Version version = connectionConfiguration.version(client);
	return new RuntimeEnvironmentInfo.Builder()
		.implementationName(implementationClass.getSimpleName())
		.spiClass(spiClass)
		.implementationVersion(RuntimeVersionUtils.getVersion(CloudFoundryAppDeployer.class))
		.platformType("Cloud Foundry")
		.platformClientVersion(RuntimeVersionUtils.getVersion(client.getClass()))
		.platformApiVersion(version.toString())
		.platformHostVersion("unknown")
		.addPlatformSpecificInfo("API Endpoint", connectionConfiguration.cloudFoundryConnectionProperties().getUrl().toString())
		.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:17,代码来源:CloudFoundryDeployerAutoConfiguration.java

示例4: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	AboutResource skipperInfo = skipperClient.info();
	Resources<Deployer> deployers = skipperClient.listDeployers();
	RuntimeEnvironmentInfo.Builder builder = new RuntimeEnvironmentInfo.Builder()
			.implementationName(skipperInfo.getVersionInfo().getServer().getName())
			.implementationVersion(skipperInfo.getVersionInfo().getServer().getVersion())
			.platformApiVersion("")
			.platformClientVersion("")
			.platformHostVersion("")
			.platformType("Skipper Managed")
			.spiClass(SkipperClient.class);
	for (Deployer d : deployers) {
		builder.addPlatformSpecificInfo(d.getName(), d.getType());
	}
	return builder.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:18,代码来源:SkipperStreamDeployer.java

示例5: createRuntimeEnvironmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
/**
 * Create the RuntimeEnvironmentInfo.
 *
 * @return the Kubernetes runtime environment info
 */
protected RuntimeEnvironmentInfo createRuntimeEnvironmentInfo(Class spiClass, Class implementationClass) {
	return new RuntimeEnvironmentInfo.Builder()
			.spiClass(spiClass)
			.implementationName(implementationClass.getSimpleName())
			.implementationVersion(RuntimeVersionUtils.getVersion(implementationClass))
			.platformType("Kubernetes")
			.platformApiVersion(client.getApiVersion())
			.platformClientVersion(RuntimeVersionUtils.getVersion(client.getClass()))
			.platformHostVersion("unknown")
			.addPlatformSpecificInfo("master-url", String.valueOf(client.getMasterUrl()))
			.addPlatformSpecificInfo("namespace", client.getNamespace())
			.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-kubernetes,代码行数:19,代码来源:AbstractKubernetesDeployer.java

示例6: testEnvironmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
/**
 * Tests support for DeployerEnvironmentInfo is implemented.
 */
@Test
public void testEnvironmentInfo() {
	RuntimeEnvironmentInfo info = appDeployer().environmentInfo();
	assertNotNull(info.getImplementationVersion());
	assertNotNull(info.getPlatformType());
	assertNotNull(info.getPlatformClientVersion());
	assertNotNull(info.getPlatformHostVersion());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:12,代码来源:AbstractAppDeployerIntegrationTests.java

示例7: testEnvironmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
/**
 * Tests support for DeployerEnvironmentInfo is implemented.
 */
@Test
public void testEnvironmentInfo() {
	RuntimeEnvironmentInfo info = taskLauncher().environmentInfo();
	assertNotNull(info.getImplementationVersion());
	assertNotNull(info.getPlatformType());
	assertNotNull(info.getPlatformClientVersion());
	assertNotNull(info.getPlatformHostVersion());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:12,代码来源:AbstractTaskLauncherIntegrationTests.java

示例8: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	String apiVersion = "v1";
	String hostVersion = "unknown";
	return new RuntimeEnvironmentInfo.Builder()
			.spiClass(AppDeployer.class)
			.implementationName(this.getClass().getSimpleName())
			.implementationVersion(RuntimeVersionUtils.getVersion(this.getClass()))
			.platformType("Mesos")
			.platformApiVersion(apiVersion)
			.platformClientVersion(RuntimeVersionUtils.getVersion(chronos.getClass()))
			.platformHostVersion(hostVersion)
			.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-mesos,代码行数:15,代码来源:ChronosTaskLauncher.java

示例9: CloudFoundry2630AndLaterTaskLauncher

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
public CloudFoundry2630AndLaterTaskLauncher(CloudFoundryClient client,
											CloudFoundryDeploymentProperties deploymentProperties,
											CloudFoundryOperations operations,
										    RuntimeEnvironmentInfo runtimeEnvironmentInfo) {
	super(client, deploymentProperties, runtimeEnvironmentInfo);
	this.client = client;
	this.deploymentProperties = deploymentProperties;
	this.operations = operations;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:10,代码来源:CloudFoundry2630AndLaterTaskLauncher.java

示例10: CloudFoundryAppDeployer

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
public CloudFoundryAppDeployer(AppNameGenerator applicationNameGenerator,
	CloudFoundryDeploymentProperties deploymentProperties,
	CloudFoundryOperations operations,
	RuntimeEnvironmentInfo runtimeEnvironmentInfo
) {
	super(deploymentProperties, runtimeEnvironmentInfo);
	this.operations = operations;
	this.applicationNameGenerator = applicationNameGenerator;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:10,代码来源:CloudFoundryAppDeployer.java

示例11: aboutController

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Bean
public AboutController aboutController(VersionInfoProperties versionInfoProperties, FeaturesProperties featuresProperties) {
	StreamDeployer streamDeployer = mock(StreamDeployer.class);
	TaskLauncher taskLauncher = mock(TaskLauncher.class);
	RuntimeEnvironmentInfo.Builder builder = new RuntimeEnvironmentInfo.Builder();
	RuntimeEnvironmentInfo appDeployerEnvInfo = builder.implementationName("testAppDepImplementationName").
			implementationVersion("testAppDepImplementationVersion").
			platformType("testAppDepPlatformType").
			platformApiVersion("testAppDepPlatformApiVersion").
			platformClientVersion("testAppDepPlatformClientVersion").spiClass(Class.class).
			platformHostVersion("testAppDepPlatformHostVersion").build();
	RuntimeEnvironmentInfo taskDeployerEnvInfo = builder.implementationName("testTaskDepImplementationName").
			implementationVersion("testTaskDepImplementationVersion").
			platformType("testTaskDepPlatformType").
			platformApiVersion("testTaskDepPlatformApiVersion").
			platformClientVersion("testTaskDepPlatformClientVersion").spiClass(Class.class).
			platformHostVersion("testTaskDepPlatformHostVersion").build();
	if (!featuresProperties.isSkipperEnabled()) {
		when(streamDeployer.environmentInfo()).thenReturn(appDeployerEnvInfo);
	}
	else {
		when(streamDeployer.environmentInfo()).thenThrow(new UnsupportedOperationException());
	}
	when(taskLauncher.environmentInfo()).thenReturn(taskDeployerEnvInfo);
	return new AboutController(streamDeployer, taskLauncher,
			mock(FeaturesProperties.class), versionInfoProperties,
			mock(SecurityStateBean.class));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:29,代码来源:TestDependencies.java

示例12: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	return super.createRuntimeEnvironmentInfo(AppDeployer.class, this.getClass());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-kubernetes,代码行数:5,代码来源:KubernetesAppDeployer.java

示例13: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	return super.createRuntimeEnvironmentInfo(TaskLauncher.class, this.getClass());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-kubernetes,代码行数:5,代码来源:KubernetesTaskLauncher.java

示例14: environmentInfo

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
@Override
public RuntimeEnvironmentInfo environmentInfo() {
	return wrapped.environmentInfo();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:5,代码来源:AbstractAppDeployerIntegrationTests.java

示例15: AbstractCloudFoundryDeployer

import org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo; //导入依赖的package包/类
AbstractCloudFoundryDeployer(CloudFoundryDeploymentProperties deploymentProperties, RuntimeEnvironmentInfo runtimeEnvironmentInfo) {
	this.deploymentProperties = deploymentProperties;
	this.runtimeEnvironmentInfo = runtimeEnvironmentInfo;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:5,代码来源:AbstractCloudFoundryDeployer.java


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