本文整理了Java中info.magnolia.config.source.yaml.YamlConfigurationSource.start()
方法的一些代码示例,展示了YamlConfigurationSource.start()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlConfigurationSource.start()
方法的具体详情如下:
包路径:info.magnolia.config.source.yaml.YamlConfigurationSource
类名称:YamlConfigurationSource
方法名:start
暂无
代码示例来源:origin: info.magnolia.core/magnolia-configuration
@Override
public void bindTo(Registry<?> registry) {
final Pattern pathPattern = validatePathPattern(this.pathPattern);
if (registry == null) {
throw new NullPointerException("Must pass a registry instance");
}
new YamlConfigurationSource<>(origin, map2BeanTransformer, registry, pathPattern, yamlReader, magnoliaConfigurationProperties, moduleRegistry).start();
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility
private <T> YamlConfigurationSource<T> mapRegistryWithYamlFolder(AbstractRegistry registry, String pathPattern) {
YamlConfigurationSource yamlSource = new YamlConfigurationSource<T>(resourceOrigin,
map2BeanTransformer,
registry,
Pattern.compile(pathPattern),
yamlReader,
magnoliaProperties,
moduleRegistry);
yamlSource.start();
return yamlSource;
}
代码示例来源:origin: info.magnolia.core/magnolia-configuration
@Before
public void setUp() throws Exception {
final ModuleRegistry moduleRegistry = mock(ModuleRegistry.class);
when(moduleRegistry.getModuleNames()).thenReturn(Sets.newHashSet("info/magnolia/config/source/yaml/samples/decorators/fooModule"));
this.registry = new DummyRegistry();
this.resourceOrigin.mountClasspathLocation("info/magnolia/config/source/yaml/samples/decorators", "/foo/decoration");
MagnoliaConfigurationProperties magnoliaProperties = mock(MagnoliaConfigurationProperties.class);
YamlConfigurationSource<DummyThing> yamlSource =
new YamlConfigurationSource<>(mock(ResourceOrigin.class),
map2BeanTransformer,
registry,
Pattern.compile("/(fooModule)/(.*)\\.yaml"),
new YamlReader(),
magnoliaProperties,
mock(ModuleRegistry.class));
yamlSource.start();
yamlSource.loadAndRegister(singleResource(foo, "/fooModule/a.yaml", getResource(DEFINITION_RESOURCE).openStream()));
this.definitionReference = new DefaultDefinitionReference("fooModule", "a", "a");
}
代码示例来源:origin: info.magnolia.core/magnolia-configuration
@Test
public void detectsYamlDefinitionDecoratorUponStart() throws Exception {
// GIVEN
final DummyResource dummyDecoratorResource = DummyResourceOrigin.singleResource(foo, "/fooModule/decorations/barModule/dummyThings/qux.yaml", mock(Reader.class, ""));
// WHEN
final YamlConfigurationSource<DummyThing> src = newDummyYamlSource(".*", new DummyRegistry(), dummyDecoratorResource.getOrigin());
src.start();
// THEN
assertThat(src.getResolvedDefinitionDecorators().entrySet(), hasSize(1));
}
代码示例来源:origin: info.magnolia.core/magnolia-configuration
@Test
public void definitionDecoratorsRemovedUponWholeDecorationFolderRemoval() throws Exception {
// GIVEN
tempFileSystemResourceOrigin.addResource("/fooModule/decorations/barModule/dummyThings/qux.yaml", "");
// WHEN
final YamlConfigurationSource<DummyThing> src = newDummyYamlSource(".*", new DummyRegistry(), tempFileSystemResourceOrigin.get());
src.start();
// THEN
assertThat(src.getResolvedDefinitionDecorators().entrySet(), hasSize(1));
// WHEN
tempFileSystemResourceOrigin.deleteResource("/fooModule/decorations/");
// THEN
assertThat(src.getResolvedDefinitionDecorators().entrySet(), empty());
}
代码示例来源:origin: info.magnolia.core/magnolia-configuration
);
sourceCreator.apply(dummyRegistry).start();
sourceCreator.apply(dummyRegistryWithNameAsId).start();
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility
@Before
public void setUp() throws Exception {
tempFileSystemResourceOrigin.mountClasspathLocation("fooModule", "");
resourceOrigin = tempFileSystemResourceOrigin.get();
ComponentsTestUtil.setImplementation(ContentTypeDefinition.class, ConfiguredContentTypeDefinition.class);
ComponentsTestUtil.setImplementation(DataSourceDefinition.class, ConfiguredJcrDataSourceDefinition.class);
ComponentsTestUtil.setImplementation(ModelDefinition.class, ConfiguredJcrModelDefinition.class);
ComponentsTestUtil.setImplementation(SubModelDefinition.class, ConfiguredJcrSubModelDefinition.class);
ComponentsTestUtil.setImplementation(PropertyDefinition.class, ConfiguredPropertyDefinition.class);
moduleRegistry = mock(ModuleRegistry.class);
appDescriptorRegistry = mock(AppDescriptorRegistry.class);
eventBus = mock(EventBus.class);
contentTypeRegistry = new ContentTypeRegistry(moduleRegistry, eventBus);
yamlReader = new YamlReader();
AppWithContentType appWithContentType = new AppWithContentType(contentTypeRegistry, appDescriptorRegistry, yamlReader, resourceOrigin);
yamlReader.registerCustomMultiConstruct(AppWithContentType.TAG_PREFIX, appWithContentType);
map2BeanTransformer = new Map2BeanTransformer(Components.getComponentProvider(), new TypeMappingImpl(), new PreConfiguredBeanUtils(), new BeanTypeResolver());
magnoliaProperties = mock(MagnoliaConfigurationProperties.class);
YamlConfigurationSource<ContentTypeDefinition> contentTypesYamlSource =
new YamlConfigurationSource<>(resourceOrigin,
map2BeanTransformer,
contentTypeRegistry,
Pattern.compile("/contentTypes/(.*)\\.yaml"),
new YamlReader(),
magnoliaProperties,
moduleRegistry);
contentTypesYamlSource.start();
contentTypeDefinition = (ConfiguredContentTypeDefinition) contentTypeRegistry.getProvider("pizza").get();
modelDefinition = (ConfiguredJcrModelDefinition) contentTypeDefinition.getModel();
}
代码示例来源:origin: info.magnolia.core/magnolia-configuration
yamlSource.start();
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility
moduleRegistry);
appsYamlSource.start();
内容来源于网络,如有侵权,请联系作者删除!