Package org.qi4j.bootstrap

Examples of org.qi4j.bootstrap.ModuleAssembly


    }

    private void assembleCommunicationLayer( LayerAssembly communicationLayer )
        throws AssemblyException
    {
        ModuleAssembly queryModule = communicationLayer.module( "COMMUNICATION-Query" );
        queryModule
            .transients(
                BookingQueries.class )
            .visibleIn( application );

        queryModule
            .values(
                CargoDTO.class,
                LocationDTO.class,
                HandlingEventDTO.class,
                VoyageDTO.class );

        queryModule
            .addServices(
                EntityToDTOService.class,
                OrgJsonValueSerializationService.class )
            .visibleIn( application );
    }
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 );

        // Non-role-playing entities
        ModuleAssembly entityNonRoleModule = contextLayer.module( "CONTEXT-EntityNonRole" );
        entityNonRoleModule
            .entities(
                LocationEntity.class,
                VoyageEntity.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 assembleDataLayer( LayerAssembly dataLayer )
        throws AssemblyException
    {
        // Non-role-playing values
        ModuleAssembly dataModule = dataLayer.module( "DATA-Data" );
        dataModule
            .values(
                TrackingId.class,
                Delivery.class,
                ExpectedHandlingEvent.class,
                UnLocode.class,
View Full Code Here

    }

    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 )
            .instantiateOnStartup()
            .visibleIn( application );

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

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

    @Override
    public void assemble( ModuleAssembly module )
            throws AssemblyException
    {
        super.assemble( module );
        ModuleAssembly config = module.layer().module( "config" );
        new EntityTestAssembler().assemble( config );
        new OrgJsonValueSerializationAssembler().assemble( module );
        new JCloudsMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
        JCloudsMapEntityStoreConfiguration defaults = config.forMixin( JCloudsMapEntityStoreConfiguration.class ).declareDefaults();
        defaults.provider().set( "filesystem" );
        Map<String, String> props = new HashMap<String, String>();
        props.put( FilesystemConstants.PROPERTY_BASEDIR, "build/tmp/" + getClass().getPackage().getName() + "/es-jclouds-" + System.currentTimeMillis() );
        defaults.properties().set( props );
    }
View Full Code Here

    @Override
    public void assemble( ModuleAssembly module )
            throws AssemblyException
    {
        super.assemble( module );
        ModuleAssembly config = module.layer().module( "config" );
        new EntityTestAssembler().assemble( config );
        new OrgJsonValueSerializationAssembler().assemble( module );
        // START SNIPPET: assembly
        new JCloudsMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
        // END SNIPPET: assembly
View Full Code Here

    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        // END SNIPPET: assembly
        super.assemble( module );
        ModuleAssembly config = module.layer().module( "config" );
        new EntityTestAssembler().assemble( config );
        new OrgJsonValueSerializationAssembler().assemble( module );

        // START SNIPPET: assembly
        // DataSourceService
View Full Code Here

    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        // END SNIPPET: assembly
        super.assemble( module );
        ModuleAssembly config = module.layer().module( "config" );
        new EntityTestAssembler().visibleIn( Visibility.module ).assemble( config );
        new OrgJsonValueSerializationAssembler().assemble( module );

        module.services( FileConfigurationService.class );

        // START SNIPPET: assembly
        new LevelDBEntityStoreAssembler().
            withConfig( config, Visibility.layer ).
            identifiedBy( "java-leveldb-entitystore" ).
            assemble( module );
        // END SNIPPET: assembly

        config.forMixin( LevelDBEntityStoreConfiguration.class ).declareDefaults().flavour().set( "java" );
        // START SNIPPET: assembly
    }
View Full Code Here

    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        super.assemble( module );

        ModuleAssembly config = module.layer().module( "config" );
        new EntityTestAssembler().visibleIn( Visibility.module ).assemble( config );
        new OrgJsonValueSerializationAssembler().assemble( module );

        module.services( FileConfigurationService.class );

        new LevelDBEntityStoreAssembler().
            withConfig( config, Visibility.layer ).
            identifiedBy( "jni-leveldb-entitystore" ).
            assemble( module );

        config.forMixin( LevelDBEntityStoreConfiguration.class ).declareDefaults().flavour().set( "jni" );
    }
View Full Code Here

    @Override
    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        ModuleAssembly configModule = module;
        Visibility configVisibility = Visibility.module;

        // START SNIPPET: memory
        new ESMemoryIndexQueryAssembler().withConfig( configModule, configVisibility ).assemble( module );
        // END SNIPPET: memory
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.