Package org.qi4j.bootstrap

Examples of org.qi4j.bootstrap.ModuleAssembly


    TestInterface service;

    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        ModuleAssembly serviceModule = module.layer().module( "Service module" );
        serviceModule.importedServices( TestInterface.class )
            .setMetaInfo( new TestService() )
            .visibleIn( Visibility.layer );
        module.objects( InstanceImporterTest.class );
    }
View Full Code Here


                module.importedServices( TestService.class )
                    .importedBy( SERVICE_SELECTOR )
                    .setMetaInfo( ServiceQualifier.withId( TestServiceComposite2.class.getSimpleName() ) );

                ModuleAssembly module2 = module.layer().module( "Other module" );
                module2.services( TestServiceComposite2.class, TestServiceComposite2.class )
                    .visibleIn( Visibility.layer );
            }
        };

        TestService service = assembler.module().newObject( ServiceConsumer.class ).getService();
View Full Code Here

                module.importedServices( TestService.class )
                    .importedBy( SERVICE_SELECTOR )
                    .setMetaInfo( ServiceQualifier.withId( "TestServiceComposite2_1" ) );

                ModuleAssembly module2 = module.layer().module( "Other module" );
                module2.addServices( TestServiceComposite2.class, TestServiceComposite2.class )
                    .visibleIn( Visibility.layer );
            }
        };

        TestService service = assembler.module().newObject( ServiceConsumer.class ).getService();
View Full Code Here

        {
            @Override
            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
                ModuleAssembly config = module.layer().module( "config" );
                new EntityTestAssembler().assemble( config );

                new OrgJsonValueSerializationAssembler().assemble( module );

                // DataSourceService
View Full Code Here

        {
            @Override
            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
                ModuleAssembly config = module.layer().module( "config" );
                config.services( MemoryEntityStoreService.class );

                // DataSourceService
                new DBCPDataSourceServiceAssembler().
                    identifiedBy( "postgresql-datasource-service" ).
                    visibleIn( Visibility.module ).
View Full Code Here

        return assembly;
    }

    private void assembleBootstrapLayer( LayerAssembly bootstrapLayer ) throws AssemblyException
    {
        ModuleAssembly bootstrapModule = bootstrapLayer.module( "BOOTSTRAP-Bootstrap" );

        // Load base data on startup
        bootstrapModule
              .addServices(
                    BaseDataService.class )
              .visibleIn( application )
              .instantiateOnStartup();
    }
View Full Code Here

    }

    private void assembleContextLayer( LayerAssembly contextLayer ) throws AssemblyException
    {
        // Role-playing entities
        ModuleAssembly entityRoleModule = contextLayer.module( "CONTEXT-EntityRole" );
        entityRoleModule
              .entities(
                    CargoRoleMap.class,
                    CargosRoleMap.class,
                    HandlingEventRoleMap.class,
                    HandlingEventsRoleMap.class )
              .visibleIn( application );


        // Role-playing values
        ModuleAssembly valueRoleModule = contextLayer.module( "CONTEXT-ValueRole" );
        valueRoleModule
              .values(
                    ItineraryRoleMap.class,
                    RouteSpecificationRoleMap.class )
              .visibleIn( application );


        ModuleAssembly contextSupportModule = contextLayer.module( "CONTEXT-ContextSupport" );
        contextSupportModule
              .addServices(
                    RoutingService.class,
                    ApplicationEvents.class )
              .visibleIn( application );

        contextSupportModule
              .values(
                    RegisterHandlingEventAttemptDTO.class )
              .visibleIn( application );
    }
View Full Code Here

    }

    private void assembleDomainLayer( LayerAssembly domainLayer ) throws AssemblyException
    {
        // Non-role-playing entities
        ModuleAssembly entityModule = domainLayer.module( "DOMAIN-Entity" );
        entityModule
              .entities(
                    LocationEntity.class,
                    VoyageEntity.class )
              .visibleIn( application );


        // Non-role-playing values
        ModuleAssembly dataModule = domainLayer.module( "DOMAIN-Data" );
        dataModule
              .values(
                    TrackingId.class,
                    Delivery.class,
                    ExpectedHandlingEvent.class,
                    UnLocode.class,
View Full Code Here

              .visibleIn( application );
    }

    private void assembleInfrastructureLayer( LayerAssembly infrastructureLayer ) throws AssemblyException
    {
        ModuleAssembly serializationModule = infrastructureLayer.module( "INFRASTRUCTURE-Serialization" );
        serializationModule
            .services( OrgJsonValueSerializationService.class )
            .taggedWith( ValueSerialization.Formats.JSON )
            .setMetaInfo( new Function<Application, Module>()
        {
            @Override
            public Module map( Application application )
            {
                return application.findModule( "CONTEXT", "CONTEXT-ContextSupport" );
            }
        } )
        .visibleIn( application );

        ModuleAssembly indexingModule = infrastructureLayer.module( "INFRASTRUCTURE-Indexing" );
        indexingModule
              .objects(
                    EntityStateSerializer.class,
                    EntityTypeSerializer.class );

        indexingModule
              .addServices(
                    MemoryRepositoryService.class,
                    RdfIndexingEngineService.class )
              .visibleIn( application );


        ModuleAssembly entityStoreModule = infrastructureLayer.module( "INFRASTRUCTURE-EntityStore" );
        entityStoreModule
              .addServices(
                    MemoryEntityStoreService.class,
                    UuidIdentityGeneratorService.class )
              .visibleIn( application );

        ModuleAssembly externalServiceModule = infrastructureLayer.module( "INFRASTRUCTURE-ExternalService" );
        externalServiceModule
              .importedServices(
                    GraphTraversalService.class )
              .setMetaInfo( new GraphTraversalServiceImpl( new GraphDAO() ) )
              .visibleIn( application );
    }
View Full Code Here

    }

    private void assembleBootstrapLayer( LayerAssembly bootstrapLayer )
        throws AssemblyException
    {
        ModuleAssembly bootstrapModule = bootstrapLayer.module( "BOOTSTRAP-Bootstrap" );
        bootstrapModule
            .objects(
                DCISampleApplication_b.class );

        bootstrapModule
            .addServices(
                BaseDataService.class )
            .instantiateOnStartup();

        bootstrapModule
            .addServices(
                SampleDataService.class )
            .instantiateOnStartup();
    }
View Full Code Here

TOP

Related Classes of org.qi4j.bootstrap.ModuleAssembly

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.