Package org.qi4j.bootstrap

Examples of org.qi4j.bootstrap.LayerAssembly.module()


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

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

    private LayerAssembly createDomainLayer( ApplicationAssembly appAssembly )
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 );
View Full Code Here

        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

        throws AssemblyException
    {
        LayerAssembly layerUI = appAssembly.layer( "UI" );

        // Add admin
        ModuleAssembly moduleAdmin = layerUI.module( "admin" );
        new AdminAssembler().assemble( moduleAdmin );

        return layerUI;
    }
}
View Full Code Here

                    // 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

    private ApplicationContext applicationContext;

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

                ApplicationAssembly applicationAssembly = layerAssembly.application();
                LayerAssembly layer2Assembly = applicationAssembly.layer( "Other layer" );
                layerAssembly.uses( layer2Assembly );

                ModuleAssembly module2 = layer2Assembly.module( "Other module" );

                ServiceDeclaration service2Decl = module2.services( MyServiceComposite2.class );
                service2Decl.identifiedBy( "Bar" ).setMetaInfo( new ServiceName( "Bar" ) ).visibleIn( application );
            }
        };
View Full Code Here

        assembly.setName( "Forum" );

        LayerAssembly configuration = assembly.layer( "Configuration" );
        {
            ModuleAssembly configModule = configuration.module( "Configuration" );
            configModule.entities( NeoConfiguration.class ).visibleIn( Visibility.application );
            configModule.services( MemoryEntityStoreService.class );
            configModule.services( UuidIdentityGeneratorService.class );
            new OrgJsonValueSerializationAssembler().assemble( configModule );
        }
View Full Code Here

            new OrgJsonValueSerializationAssembler().assemble( configModule );
        }

        LayerAssembly infrastructure = assembly.layer( "Infrastructure" ).uses( configuration );
        {
            ModuleAssembly entityStore = infrastructure.module( "EntityStore" );
            entityStore.services( FileConfigurationService.class );
            entityStore.services( NeoEntityStoreService.class ).visibleIn( Visibility.application );
            entityStore.services( UuidIdentityGeneratorService.class ).visibleIn( Visibility.application );
            new OrgJsonValueSerializationAssembler().
                visibleIn( Visibility.application ).
View Full Code Here

                assemble( entityStore );
        }

        LayerAssembly data = assembly.layer( "Data" ).uses( infrastructure );
        {
            ModuleAssembly forum = data.module( "Forum" );
            for( Class<?> dataClass : filter( hasModifier( Modifier.INTERFACE ), filter( isAssignableFrom( EntityComposite.class ), ClassScanner
                .findClasses( User.class ) ) ) )
            {
                forum.entities( dataClass ).visibleIn( Visibility.application );
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.