use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class SchoolAssembler method createInfrastructureLayer.
private LayerAssembly createInfrastructureLayer(ApplicationAssembly appAssembly) throws AssemblyException {
LayerAssembly layerInfrastructure = appAssembly.layer("Infrastructure");
ModuleAssembly moduleMail = layerInfrastructure.module("Mail");
new MailServiceAssembler().assemble(moduleMail);
ModuleAssembly modulePersistence = layerInfrastructure.module("Persistence");
new PersistenceAssembler().assemble(modulePersistence);
return layerInfrastructure;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class SchoolAssembler method createDomainLayer.
private LayerAssembly createDomainLayer(ApplicationAssembly appAssembly) throws AssemblyException {
LayerAssembly layerDomain = appAssembly.layer("domain");
ModuleAssembly modulePerson = layerDomain.module("person");
new PersonModelAssembler().assemble(modulePerson);
ModuleAssembly moduleSchool = layerDomain.module("school");
new SchoolModelAssembler().assemble(moduleSchool);
return layerDomain;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class SchoolAssembler method createUILayer.
private LayerAssembly createUILayer(ApplicationAssembly appAssembly) throws AssemblyException {
LayerAssembly layerUI = appAssembly.layer("UI");
// Add admin
ModuleAssembly moduleAdmin = layerUI.module("admin");
new AdminAssembler().assemble(moduleAdmin);
return layerUI;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class ApplicationAssemblyFactoryImpl method newApplicationAssembly.
@Override
public ApplicationAssembly newApplicationAssembly(Assembler[][][] assemblers) throws AssemblyException {
ApplicationAssembly applicationAssembly = newApplicationAssembly();
// Build all layers bottom-up
LayerAssembly below = null;
for (int layer = assemblers.length - 1; layer >= 0; layer--) {
// Create Layer
LayerAssembly layerAssembly = applicationAssembly.layer("Layer " + (layer + 1));
for (int module = 0; module < assemblers[layer].length; module++) {
// Create Module
ModuleAssembly moduleAssembly = layerAssembly.module("Module " + (module + 1));
for (Assembler assembler : assemblers[layer][module]) {
// Register Assembler
assembler.assemble(moduleAssembly);
}
}
if (below != null) {
// Link layers
layerAssembly.uses(below);
}
below = layerAssembly;
}
return applicationAssembly;
}
use of org.qi4j.bootstrap.LayerAssembly in project qi4j-sdk by Qi4j.
the class LayerDeclaration method initialize.
void initialize(HashMap<String, LayerAssembly> createdLayers) throws AssemblyException {
for (String uses : using) {
LayerAssembly usedLayer = createdLayers.get(uses);
layer.uses(usedLayer);
}
for (ModuleDeclaration module : modules.values()) {
module.initialize();
}
}
Aggregations