Package org.torquebox.core.datasource

Examples of org.torquebox.core.datasource.DataSourceInfoListService


        List<DatabaseMetaData> allMetaData = unit.getAttachmentList( DatabaseMetaData.ATTACHMENTS );

        Set<String> adapterIds = new HashSet<String>();

        DataSourceInfoListService dsInfoService = new DataSourceInfoListService( org.jboss.logmanager.Logger.getLogger( "com.arjuna.ats" ).getLevel() );
        ServiceBuilder<DataSourceInfoList> dsInfoBuilder = phaseContext.getServiceTarget().addService( DataSourceServices.dataSourceInfoName( unit ), dsInfoService );

        for (DatabaseMetaData each : allMetaData) {

            if (!isXAExplicitlyEnabled( each )) {
                continue;
            }

            if (each.getConfiguration().containsKey( "jndi" )) {
                continue;
            }

            String adapterName = (String) each.getConfiguration().get( "adapter" );

            Adapter adapter = getAdapter( adapterName );

            if (adapter == null) {
                log.warnf( "Not enabling XA for unknown adapter type: %s", adapterName );
                continue;
            }

            if (adapterIds.add( adapter.getId() )) {
                processDriver( phaseContext, adapter, applicationDir );
            }

            try {
                ServiceName dsVerifierServiceName = processDataSource( phaseContext, each, adapter );
                dsInfoBuilder.addDependency( dsVerifierServiceName, Info.class, dsInfoService.getInfoInjector() );
            } catch (ValidateException e) {
                log.warnf( "Unable to add data-source: %s", each.getConfigurationName() );
                throw new DeploymentUnitProcessingException( e );
            }
        }
View Full Code Here

TOP

Related Classes of org.torquebox.core.datasource.DataSourceInfoListService

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.