use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.
the class DerbySQLEntityStoreTest method assemble.
@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
// END SNIPPET: assembly
super.assemble(module);
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("derby-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("derby-datasource-service").identifiedBy("derby-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
// SQL EntityStore
new DerbySQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.
the class H2SQLEntityStoreTest method assemble.
@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
// END SNIPPET: assembly
super.assemble(module);
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("h2-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("h2-datasource-service").identifiedBy("h2-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
// SQL EntityStore
new H2SQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.
the class ElasticSearchFinderTest method assemble.
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
super.assemble(module);
// Config module
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
// Index/Query
new ESFilesystemIndexQueryAssembler().withConfig(config, Visibility.layer).assemble(module);
ElasticSearchConfiguration esConfig = config.forMixin(ElasticSearchConfiguration.class).declareDefaults();
esConfig.indexNonAggregatedAssociations().set(Boolean.TRUE);
// FileConfig
FileConfigurationOverride override = new FileConfigurationOverride().withData(new File(DATA_DIR, "qi4j-data")).withLog(new File(DATA_DIR, "qi4j-logs")).withTemporary(new File(DATA_DIR, "qi4j-temp"));
module.services(FileConfigurationService.class).setMetaInfo(override);
}
use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.
the class ElasticSearchQueryTest method assemble.
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
super.assemble(module);
// Config module
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
// Index/Query
new ESFilesystemIndexQueryAssembler().withConfig(config, Visibility.layer).assemble(module);
ElasticSearchConfiguration esConfig = config.forMixin(ElasticSearchConfiguration.class).declareDefaults();
esConfig.indexNonAggregatedAssociations().set(Boolean.TRUE);
// FileConfig
FileConfigurationOverride override = new FileConfigurationOverride().withData(new File(DATA_DIR, "qi4j-data")).withLog(new File(DATA_DIR, "qi4j-logs")).withTemporary(new File(DATA_DIR, "qi4j-temp"));
module.services(FileConfigurationService.class).setMetaInfo(override);
}
use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.
the class ElasticSearchTest method assemble.
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
// Config module
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
// EntityStore
new EntityTestAssembler().assemble(module);
// Index/Query
new ESFilesystemIndexQueryAssembler().withConfig(config, Visibility.layer).assemble(module);
ElasticSearchConfiguration esConfig = config.forMixin(ElasticSearchConfiguration.class).declareDefaults();
esConfig.indexNonAggregatedAssociations().set(Boolean.TRUE);
// FileConfig
FileConfigurationOverride override = new FileConfigurationOverride().withData(new File(DATA_DIR, "qi4j-data")).withLog(new File(DATA_DIR, "qi4j-logs")).withTemporary(new File(DATA_DIR, "qi4j-temp"));
module.services(FileConfigurationService.class).setMetaInfo(override);
// Entities & Values
module.entities(Post.class, Page.class, Author.class, Comment.class);
module.values(Tagline.class);
}
Aggregations