Search in sources :

Example 21 with LayerAssembly

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);
}
Also used : LayerAssembly(org.qi4j.bootstrap.LayerAssembly)

Example 22 with LayerAssembly

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));
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) LayerAssembly(org.qi4j.bootstrap.LayerAssembly)

Example 23 with LayerAssembly

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;
}
Also used : ApplicationAssembly(org.qi4j.bootstrap.ApplicationAssembly) LayerAssembly(org.qi4j.bootstrap.LayerAssembly)

Example 24 with LayerAssembly

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;
}
Also used : ApplicationAssembly(org.qi4j.bootstrap.ApplicationAssembly) LayerAssembly(org.qi4j.bootstrap.LayerAssembly)

Example 25 with LayerAssembly

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;
}
Also used : ApplicationAssembly(org.qi4j.bootstrap.ApplicationAssembly) LayerAssembly(org.qi4j.bootstrap.LayerAssembly)

Aggregations

LayerAssembly (org.qi4j.bootstrap.LayerAssembly)31 ApplicationAssembly (org.qi4j.bootstrap.ApplicationAssembly)16 ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)15 AssemblyException (org.qi4j.bootstrap.AssemblyException)5 Test (org.junit.Test)4 Application (org.qi4j.api.structure.Application)4 ApplicationAssembler (org.qi4j.bootstrap.ApplicationAssembler)4 ApplicationAssemblyFactory (org.qi4j.bootstrap.ApplicationAssemblyFactory)4 Energy4Java (org.qi4j.bootstrap.Energy4Java)4 ApplicationDescriptor (org.qi4j.api.structure.ApplicationDescriptor)3 HashMap (java.util.HashMap)2 OrgJsonValueSerializationAssembler (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ActivationEventListener (org.qi4j.api.activation.ActivationEventListener)1 EntityComposite (org.qi4j.api.entity.EntityComposite)1 Layer (org.qi4j.api.structure.Layer)1 LayerDescriptor (org.qi4j.api.structure.LayerDescriptor)1 Module (org.qi4j.api.structure.Module)1 Assembler (org.qi4j.bootstrap.Assembler)1