Package org.qi4j.library.sql.assembly

Examples of org.qi4j.library.sql.assembly.DataSourceAssembler


                assemble( module );
            // END SNIPPET: dbcp

            // START SNIPPET: datasource
            // Assemble a DataSource
            new DataSourceAssembler().
                withDataSourceServiceIdentity( DS_SERVICE_ID ).
                identifiedBy( DS_ID ).
                visibleIn( Visibility.module ).
                assemble( module );
            // Another DataSource managed by the same C3P0 connection pool
            new DataSourceAssembler().
                withDataSourceServiceIdentity( DS_SERVICE_ID ).
                identifiedBy( OTHER_DS_ID ).
                visibleIn( Visibility.module ).
                assemble( module );
            // END SNIPPET: datasource
View Full Code Here


                {
                    ModuleAssembly testModule = module.layer().module( "TestDS" );

                    // Create a specific DataSource that uses the "datasource" service to do the main work
                    new DataSourceAssembler().
                            withDataSourceServiceIdentity( "datasource-service" ).
                            identifiedBy( "testds" ).
                            visibleIn( Visibility.module ).
                            withCircuitBreaker( DataSources.newDataSourceCircuitBreaker() ).
                            assemble( testModule );

                    // Set up Liquibase service that will create the tables
                    testModule.services( LiquibaseService.class ).identifiedBy( "liquibase1" ).instantiateOnStartup();
                    testModule.entities( LiquibaseConfiguration.class );
                    testModule.forMixin( LiquibaseConfiguration.class ).declareDefaults().enabled().set( true );
                    testModule.forMixin( LiquibaseConfiguration.class ).declareDefaults().changeLog().set( "changelog.xml" );
                }

                {
                    ModuleAssembly testModule2 = module.layer().module( "TestDS2" );

                    // Create another specific DataSource that uses the "datasource" service to do the main work
                    // Use DataSourceAssembler to assemble the DataSource.
                    new DataSourceAssembler().
                            withDataSourceServiceIdentity( "datasource-service" ).
                            identifiedBy( "testds2" ).
                            visibleIn( Visibility.module ).
                            withCircuitBreaker( DataSources.newDataSourceCircuitBreaker() ).
                            assemble( testModule2 );
View Full Code Here

                new C3P0DataSourceServiceAssembler().
                    identifiedBy( "datasource-service" ).
                    withConfig( configModule, Visibility.layer ).
                    assemble( module );
                new DataSourceAssembler().
                    withDataSourceServiceIdentity( "datasource-service" ).
                    identifiedBy( "testds-liquibase" ).
                    withCircuitBreaker().
                    assemble( module );
View Full Code Here

TOP

Related Classes of org.qi4j.library.sql.assembly.DataSourceAssembler

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.