Package org.qi4j.bootstrap

Examples of org.qi4j.bootstrap.LayerAssembly


    {
        final ApplicationAssembly appAssembly = applicationFactory.newApplicationAssembly();
        appAssembly.setName( "School" );

        // Create layers
        LayerAssembly layerUI = createUILayer( appAssembly );
        LayerAssembly layerDomain = createDomainLayer( appAssembly );
        LayerAssembly layerInfra = createInfrastructureLayer( appAssembly );
        LayerAssembly layerConfig = createConfigLayer( appAssembly );

        layerUI.uses( layerDomain );
        layerDomain.uses( layerInfra );
        layerDomain.uses( layerConfig );
View Full Code Here


    }

    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;
    }
View Full Code Here

    }

    private LayerAssembly createConfigLayer( ApplicationAssembly appAssembly )
        throws AssemblyException
    {
        LayerAssembly layerConfig = appAssembly.layer( "configuration" );

        ModuleAssembly persistenceConfig = layerConfig.module( "persistence" );
        new PersistenceConfigAssembler().assemble( persistenceConfig );
        return layerConfig;
    }
View Full Code Here

    }

    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;
    }
View Full Code Here

    }

    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;
    }
View Full Code Here

                    throws AssemblyException
                {
                    new LayerName( "Plugin layer" ).assemble( module );
                    new ModuleName( "Plugin module" ).assemble( module );

                    LayerAssembly layer = module.layer();

                    // In a real case you would "detect" the plugins somehow. Here the plugin assembler is hardcoded
                    List<Assembler> pluginAssemblers = Collections.<Assembler>singletonList( new SimonAssembler() );

                    for( int i = 0; i < pluginAssemblers.size(); i++ )
                    {
                        ModuleAssembly pluginModule = layer.module( "Plugin " + ( i + 1 ) );
                        Assembler assembler = pluginAssemblers.get( i );
                        assembler.assemble( pluginModule );
                    }

                    // Import host services
View Full Code Here

        throws AssemblyException
    {
        String applicationName = "Example Application";
        ApplicationAssembly app = factory.newApplicationAssembly();
        app.setName( applicationName );
        LayerAssembly webLayer = createWebLayer( app );
        LayerAssembly domainLayer = createDomainLayer( app );
        LayerAssembly infraLayer = createInfrastructureLayer( app );
        webLayer.uses( domainLayer );
        webLayer.uses( infraLayer )// Accesses the WebService
        domainLayer.uses( infraLayer ); // For persistence
        return app;
    }
View Full Code Here

    private static LayerAssembly createWebLayer(
        ApplicationAssembly application
    )
    {
        LayerAssembly layer = application.layer( "Web Layer" );
        createCustomerWebModule( layer );
        return layer;
    }
View Full Code Here

    private static LayerAssembly createDomainLayer(
        ApplicationAssembly application
    )
    {
        LayerAssembly layer = application.layer( "Domain Layer" );
        createCustomerDomainModule( layer );
        // :
        // :
        return layer;
    }
View Full Code Here

    private static LayerAssembly createInfrastructureLayer(
        ApplicationAssembly application
    )
        throws AssemblyException
    {
        LayerAssembly layer = application.layer( "Infrastructure Layer" );
        createWebServiceModule( layer );
        createPersistenceModule( layer );
        return layer;
    }
View Full Code Here

TOP

Related Classes of org.qi4j.bootstrap.LayerAssembly

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.