use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class ApplicationXmlTest method assemble.
public void assemble(ModuleAssembly module) throws AssemblyException {
LayerAssembly layerAssembly = module.layer();
layerAssembly.application().setName("testapp");
module.transients(TestComposite.class);
module.services(FileConfigurationService.class);
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class Qi4jTestBootstrap method assemble.
public final void assemble(ApplicationAssembly applicationAssembly) throws AssemblyException {
LayerAssembly layerAssembly = applicationAssembly.layer(LAYER);
ModuleAssembly moduleAssembly = layerAssembly.module(MODULE);
moduleAssembly.services(CommentServiceComposite.class).identifiedBy(COMMENT_SERVICE_ID);
// inject Spring bean as a service
moduleAssembly.importedServices(TextProcessingService.class).setMetaInfo(this.applicationContext.getBean(TO_UPPERCASE_SERVICE_ID));
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class Assembler method assemble.
@Override
public ApplicationAssembly assemble(ApplicationAssemblyFactory applicationFactory) throws AssemblyException {
// Application assembly
ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
assembly.setName("DCI Sample (version B)");
assembly.setVersion("B.1.0");
assembly.setMode(development);
// Layers (adding bottom-up - will be assembled in this order)
LayerAssembly infrastructureLayer = assembly.layer("INFRASTRUCTURE");
LayerAssembly dataLayer = assembly.layer("DATA");
LayerAssembly contextLayer = assembly.layer("CONTEXT");
LayerAssembly communicationLayer = assembly.layer("COMMUNICATION");
LayerAssembly bootstrapLayer = assembly.layer("BOOTSTRAP");
// Layer dependencies
bootstrapLayer.uses(communicationLayer, contextLayer, dataLayer, infrastructureLayer);
communicationLayer.uses(contextLayer, dataLayer, infrastructureLayer);
contextLayer.uses(dataLayer, infrastructureLayer);
dataLayer.uses(infrastructureLayer);
// Assemble
assembleBootstrapLayer(bootstrapLayer);
assembleCommunicationLayer(communicationLayer);
assembleContextLayer(contextLayer);
assembleDataLayer(dataLayer);
assembleInfrastructureLayer(infrastructureLayer);
return assembly;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class TestAssembler method assemble.
public ApplicationAssembly assemble(ApplicationAssemblyFactory applicationFactory) throws AssemblyException {
// Application assembly
ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
assembly.setName("DCI Sample (version A) - TEST");
assembly.setVersion("A.1.0");
assembly.setMode(test);
// Layers
LayerAssembly infrastructureLayer = assembly.layer("INFRASTRUCTURE");
LayerAssembly domainLayer = assembly.layer("DOMAIN");
LayerAssembly contextLayer = assembly.layer("CONTEXT");
LayerAssembly bootstrapLayer = assembly.layer("BOOTSTRAP");
// Layer dependencies
bootstrapLayer.uses(contextLayer, domainLayer, infrastructureLayer);
contextLayer.uses(domainLayer, infrastructureLayer);
domainLayer.uses(contextLayer, infrastructureLayer);
// Assemble
assembleDomainLayer(domainLayer);
assembleContextLayer(contextLayer);
assembleBootstrapLayer(bootstrapLayer);
assembleInfrastructureLayer(infrastructureLayer);
return assembly;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class TestAssembler method assemble.
public ApplicationAssembly assemble(ApplicationAssemblyFactory applicationFactory) throws AssemblyException {
// Application assembly
ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
assembly.setName("DCI Sample (version A) - TEST");
assembly.setVersion("B.1.0");
assembly.setMode(test);
// Layers
LayerAssembly infrastructureLayer = assembly.layer("INFRASTRUCTURE");
LayerAssembly dataLayer = assembly.layer("DATA");
LayerAssembly contextLayer = assembly.layer("CONTEXT");
LayerAssembly bootstrapLayer = assembly.layer("BOOTSTRAP");
// Layer dependencies
bootstrapLayer.uses(contextLayer, dataLayer, infrastructureLayer);
contextLayer.uses(dataLayer, infrastructureLayer);
dataLayer.uses(infrastructureLayer);
// Assemble
assembleDomainLayer(dataLayer);
assembleContextLayer(contextLayer);
assembleBootstrapLayer(bootstrapLayer);
assembleInfrastructureLayer(infrastructureLayer);
return assembly;
}
Aggregations