本文整理汇总了Java中org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader类的典型用法代码示例。如果您正苦于以下问题:Java DelegatingResourceLoader类的具体用法?Java DelegatingResourceLoader怎么用?Java DelegatingResourceLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DelegatingResourceLoader类属于org.springframework.cloud.deployer.resource.support包,在下文中一共展示了DelegatingResourceLoader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testGetResourceExceptionHandler
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testGetResourceExceptionHandler() {
DelegatingResourceLoader resourceLoader = mock(DelegatingResourceLoader.class);
AppDeploymentRequestFactory appDeploymentRequestFactory = new AppDeploymentRequestFactory(resourceLoader);
when(resourceLoader.getResource(anyString())).thenThrow(Exception.class);
SpringCloudDeployerApplicationManifest applicationSpec = mock(SpringCloudDeployerApplicationManifest.class);
SpringCloudDeployerApplicationSpec springCloudDeployerApplicationSpec = mock(SpringCloudDeployerApplicationSpec.class);
when(applicationSpec.getSpec()).thenReturn(springCloudDeployerApplicationSpec);
String specResource = "http://test";
when(springCloudDeployerApplicationSpec.getResource()).thenReturn(specResource);
when(springCloudDeployerApplicationSpec.getApplicationProperties()).thenReturn(null);
try {
appDeploymentRequestFactory.createAppDeploymentRequest(applicationSpec, "release1", "1.0.0");
fail("SkipperException is expected to be thrown.");
}
catch (SkipperException e) {
assertThat(e.getMessage()).contains("Could not load Resource " + specResource + ".");
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:21,代码来源:AppDeploymentRequestFactoryTests.java
示例2: delegatingResourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public DelegatingResourceLoader delegatingResourceLoader(MavenConfigurationProperties mavenProperties) {
DockerResourceLoader dockerLoader = new DockerResourceLoader();
MavenResourceLoader mavenResourceLoader = new MavenResourceLoader(mavenProperties);
Map<String, ResourceLoader> loaders = new HashMap<>();
loaders.put("docker", dockerLoader);
loaders.put("maven", mavenResourceLoader);
return new DelegatingResourceLoader(loaders);
}
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:10,代码来源:SkipperServerConfiguration.java
示例3: delegatingResourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(DelegatingResourceLoader.class)
public DelegatingResourceLoader delegatingResourceLoader(MavenResourceLoader mavenResourceLoader) {
Map<String, ResourceLoader> loaders = new HashMap<>();
loaders.put("maven", mavenResourceLoader);
return new DelegatingResourceLoader(loaders);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:8,代码来源:DataFlowControllerAutoConfiguration.java
示例4: resourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public ResourceLoader resourceLoader() {
MavenProperties mavenProperties = new MavenProperties();
mavenProperties.setRemoteRepositories(new HashMap<>(Collections.singletonMap("springRepo",
new MavenProperties.RemoteRepository("https://repo.spring.io/libs-snapshot"))));
Map<String, ResourceLoader> resourceLoaders = new HashMap<>();
resourceLoaders.put("maven", new MavenResourceLoader(mavenProperties));
resourceLoaders.put("file", new FileSystemResourceLoader());
DelegatingResourceLoader delegatingResourceLoader = new DelegatingResourceLoader(resourceLoaders);
return delegatingResourceLoader;
}
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:14,代码来源:TestDependencies.java
示例5: testLocalAutoConfigApplied
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Test
public void testLocalAutoConfigApplied() throws Exception {
SpringApplication app = new SpringApplication(LocalTestDataFlowServer.class);
context = app.run(new String[] { "--server.port=0" });
// default on DataFlowControllerAutoConfiguration only adds maven,
// LocalDataFlowServerAutoConfiguration also adds docker so test on those.
LRUCleaningResourceLoader lruCleaningResourceLoader = context.getBean(LRUCleaningResourceLoader.class);
DelegatingResourceLoader delegatingResourceLoader =
(DelegatingResourceLoader)TestUtils.readField("delegate", lruCleaningResourceLoader);
Map<String, ResourceLoader> loaders = TestUtils.readField("loaders", delegatingResourceLoader);
assertThat(loaders.size(), is(2));
assertThat(loaders.get("maven"), notNullValue());
assertThat(loaders.get("docker"), notNullValue());
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:16,代码来源:LocalConfigurationTests.java
示例6: taskService
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
@ConditionalOnBean(TaskDefinitionRepository.class)
public TaskService taskService(TaskDefinitionRepository repository, TaskExplorer taskExplorer,
TaskRepository taskExecutionRepository, AppRegistryCommon registry, DelegatingResourceLoader resourceLoader,
TaskLauncher taskLauncher, ApplicationConfigurationMetadataResolver metadataResolver,
TaskConfigurationProperties taskConfigurationProperties, DeploymentIdRepository deploymentIdRepository) {
return new DefaultTaskService(dataSourceProperties, repository, taskExplorer, taskExecutionRepository, registry,
resourceLoader, taskLauncher, metadataResolver, taskConfigurationProperties, deploymentIdRepository,
this.dataflowServerUri);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:11,代码来源:TaskConfiguration.java
示例7: resourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public DelegatingResourceLoader resourceLoader(MavenProperties mavenProperties) {
Map<String, ResourceLoader> resourceLoaders = new HashMap<>();
resourceLoaders.put("maven", new MavenResourceLoader(mavenProperties));
resourceLoaders.put("file", new FileSystemResourceLoader());
DelegatingResourceLoader delegatingResourceLoader = new DelegatingResourceLoader(resourceLoaders);
return delegatingResourceLoader;
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:10,代码来源:TestDependencies.java
示例8: taskDefinitionController
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public TaskDefinitionController taskDefinitionController(TaskDefinitionRepository repository,
DeploymentIdRepository deploymentIdRepository, ApplicationConfigurationMetadataResolver metadataResolver,
AppRegistryCommon appRegistry, DelegatingResourceLoader delegatingResourceLoader) {
return new TaskDefinitionController(repository, deploymentIdRepository, taskLauncher(), appRegistry,
taskService(metadataResolver, taskRepository(), deploymentIdRepository, appRegistry, delegatingResourceLoader));
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:8,代码来源:TestDependencies.java
示例9: taskExecutionController
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public TaskExecutionController taskExecutionController(TaskExplorer explorer,
ApplicationConfigurationMetadataResolver metadataResolver, DeploymentIdRepository deploymentIdRepository,
AppRegistryCommon appRegistry, DelegatingResourceLoader delegatingResourceLoader) {
return new TaskExecutionController(explorer,
taskService(metadataResolver, taskRepository(), deploymentIdRepository, appRegistry, delegatingResourceLoader),
taskDefinitionRepository());
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:9,代码来源:TestDependencies.java
示例10: taskService
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public TaskService taskService(ApplicationConfigurationMetadataResolver metadataResolver,
TaskRepository taskExecutionRepository, DeploymentIdRepository deploymentIdRepository,
AppRegistryCommon appRegistry, DelegatingResourceLoader delegatingResourceLoader) {
return new DefaultTaskService(new DataSourceProperties(), taskDefinitionRepository(), taskExplorer(),
taskExecutionRepository, appRegistry, delegatingResourceLoader, taskLauncher(), metadataResolver,
new TaskConfigurationProperties(), deploymentIdRepository, null);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:9,代码来源:TestDependencies.java
示例11: delegatingResourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public DelegatingResourceLoader delegatingResourceLoader(MavenProperties mavenProperties) {
DockerResourceLoader dockerLoader = new DockerResourceLoader();
MavenResourceLoader mavenResourceLoader = new MavenResourceLoader(mavenProperties);
Map<String, ResourceLoader> loaders = new HashMap<>();
loaders.put("docker", dockerLoader);
loaders.put("maven", mavenResourceLoader);
return new DelegatingResourceLoader(loaders);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:10,代码来源:LocalDataFlowServerAutoConfiguration.java
示例12: delegatingResourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public DelegatingResourceLoader delegatingResourceLoader(MavenResourceLoader mavenResourceLoader) {
Map<String, ResourceLoader> loaders = new HashMap<>(1);
loaders.put("maven", mavenResourceLoader);
return new DelegatingResourceLoader(loaders);
}
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:9,代码来源:ResourceLoadingAutoConfiguration.java
示例13: testTaskLauncher
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Test
public void testTaskLauncher() {
MavenResourceLoader mavenResourceLoader =
context.getBean(MavenResourceLoader.class);
assertNotNull(mavenResourceLoader);
DelegatingResourceLoader delegatingResourceLoader =
context.getBean(DelegatingResourceLoader.class);
assertNotNull(delegatingResourceLoader);
MavenProperties mavenProperties =
context.getBean(MavenProperties.class);
assertNotNull(mavenProperties);
}
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:15,代码来源:ResourceLoadingAutoConfigurationTests.java
示例14: appDeploymentRequestFactory
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public AppDeploymentRequestFactory appDeploymentRequestFactory(DelegatingResourceLoader delegatingResourceLoader) {
return new AppDeploymentRequestFactory(delegatingResourceLoader);
}
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:5,代码来源:SkipperServerConfiguration.java
示例15: appRegistry
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public AppRegistry appRegistry(UriRegistry uriRegistry, DelegatingResourceLoader resourceLoader,
EavRegistryRepository eavRegistryRepository) {
return new AppRegistry(uriRegistry, resourceLoader, eavRegistryRepository);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:6,代码来源:DataFlowControllerAutoConfiguration.java
示例16: appRegistryService
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public AppRegistryService appRegistryService(AppRegistrationRepository appRegistrationRepository,
DelegatingResourceLoader resourceLoader, MavenProperties mavenProperties) {
return new DefaultAppRegistryService(appRegistrationRepository, resourceLoader, mavenProperties);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:6,代码来源:DataFlowControllerAutoConfiguration.java
示例17: appRegistry
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public AppRegistry appRegistry(UriRegistry uriRegistry, DelegatingResourceLoader resourceLoader,
MavenProperties mavenProperties) {
return new AppRegistry(uriRegistry, resourceLoader, mavenProperties);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:6,代码来源:DataFlowControllerAutoConfiguration.java
示例18: appRegistry
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
@ConditionalOnSkipperDisabled
public AppRegistry appRegistry(UriRegistry uriRegistry, DelegatingResourceLoader resourceLoader) {
return new AppRegistry(uriRegistry, resourceLoader);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:6,代码来源:TestDependencies.java
示例19: appRegistryService
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
@ConditionalOnSkipperEnabled
public AppRegistryService appRegistryService(AppRegistrationRepository appRegistrationRepository,
DelegatingResourceLoader resourceLoader, MavenProperties mavenProperties) {
return new DefaultAppRegistryService(appRegistrationRepository, resourceLoader, mavenProperties);
}
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:7,代码来源:TestDependencies.java
示例20: delegatingResourceLoader
import org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader; //导入依赖的package包/类
@Bean
public DelegatingResourceLoader delegatingResourceLoader(MavenResourceLoader mavenResourceLoader) {
HashMap<String, ResourceLoader> map = new HashMap<>();
map.put("maven", mavenResourceLoader);
return new DelegatingResourceLoader(map);
}
开发者ID:spring-cloud,项目名称:spring-cloud-cli,代码行数:7,代码来源:DeployerConfiguration.java
注:本文中的org.springframework.cloud.deployer.resource.support.DelegatingResourceLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论