connector/src/main/java/org/jboss/as/connector/deployers/ds/processors/DsXmlDeploymentInstallProcessor.java
@Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);

        final List<DataSources> dataSourcesList = deploymentUnit.getAttachmentList(DsXmlDeploymentParsingProcessor.DATA_SOURCES_ATTACHMENT_KEY);

        final boolean legacySecurityPresent = phaseContext.getDeploymentUnit().hasAttachment(SecurityAttachments.SECURITY_ENABLED);

        for(DataSources dataSources : dataSourcesList) {
            if (dataSources.getDrivers() != null && dataSources.getDrivers().size() > 0) {
                ConnectorLogger.DS_DEPLOYER_LOGGER.driversElementNotSupported(deploymentUnit.getName());
            }

            ServiceTarget serviceTarget = phaseContext.getServiceTarget();

            if (dataSources.getDataSource() != null && dataSources.getDataSource().size() > 0) {
                for (int i = 0; i < dataSources.getDataSource().size(); i++) {
                    DataSource ds = (DataSource)dataSources.getDataSource().get(i);
                    if (ds.isEnabled() && ds.getDriver() != null) {
                        try {
                            final String jndiName = Util.cleanJndiName(ds.getJndiName(), ds.isUseJavaContext());
                            LocalDataSourceService lds = new LocalDataSourceService(jndiName, ContextNames.bindInfoFor(jndiName));
                            lds.getDataSourceConfigInjector().inject(buildDataSource(ds));
                            final String dsName = ds.getJndiName();
                            final PathAddress addr = getDataSourceAddress(dsName, deploymentUnit, false);
                            installManagementModel(ds, deploymentUnit, addr);
                            // TODO why have we been ignoring a configured legacy security domain but no legacy security present?
                            boolean useLegacySecurity = legacySecurityPresent && isLegacySecurityRequired(ds.getSecurity());
                            startDataSource(lds, jndiName, ds.getDriver(), serviceTarget,
                                    getRegistration(false, deploymentUnit), getResource(dsName, false, deploymentUnit), dsName, useLegacySecurity, ds.isJTA(), support);
                        } catch (Exception e) {
                            throw ConnectorLogger.ROOT_LOGGER.exceptionDeployingDatasource(e, ds.getJndiName());
                        }
                    } else {
                        ConnectorLogger.DS_DEPLOYER_LOGGER.debugf("Ignoring: %s", ds.getJndiName());
                    }
                }
            }

            if (dataSources.getXaDataSource() != null && dataSources.getXaDataSource().size() > 0) {
               for (int i = 0; i < dataSources.getXaDataSource().size(); i++) {
                    XaDataSource xads = (XaDataSource)dataSources.getXaDataSource().get(i);
                    if (xads.isEnabled() && xads.getDriver() != null) {
                        try {
                            String jndiName = Util.cleanJndiName(xads.getJndiName(), xads.isUseJavaContext());
                            XaDataSourceService xds = new XaDataSourceService(jndiName, ContextNames.bindInfoFor(jndiName));
                            xds.getDataSourceConfigInjector().inject(buildXaDataSource(xads));
                            final String dsName = xads.getJndiName();
                            final PathAddress addr = getDataSourceAddress(dsName, deploymentUnit, true);
                            installManagementModel(xads, deploymentUnit, addr);
                            final Credential credential = xads.getRecovery() == null? null: xads.getRecovery().getCredential();
                            // TODO why have we been ignoring a configured legacy security domain but no legacy security present?
                            boolean useLegacySecurity = legacySecurityPresent && (isLegacySecurityRequired(xads.getSecurity())
                                                        || isLegacySecurityRequired(credential));
                            startDataSource(xds, jndiName, xads.getDriver(), serviceTarget,
                                    getRegistration(true, deploymentUnit), getResource(dsName, true, deploymentUnit), dsName, useLegacySecurity, true, support);

                        } catch (Exception e) {
                            throw ConnectorLogger.ROOT_LOGGER.exceptionDeployingDatasource(e, xads.getJndiName());
                        }
                    } else {
                        ConnectorLogger.DS_DEPLOYER_LOGGER.debugf("Ignoring %s", xads.getJndiName());
                    }
                }
            }
        }

    }
@Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);

        final List<DataSources> dataSourcesList = deploymentUnit.getAttachmentList(DsXmlDeploymentParsingProcessor.DATA_SOURCES_ATTACHMENT_KEY);

        final boolean legacySecurityPresent = phaseContext.getDeploymentUnit().hasAttachment(SecurityAttachments.SECURITY_ENABLED);

        for(DataSources dataSources : dataSourcesList) {
            if (dataSources.getDrivers() != null && dataSources.getDrivers().size() > 0) {
                ConnectorLogger.DS_DEPLOYER_LOGGER.driversElementNotSupported(deploymentUnit.getName());
            }

            ServiceTarget serviceTarget = phaseContext.getServiceTarget();

            if (dataSources.getDataSource() != null && dataSources.getDataSource().size() > 0) {
                for (int i = 0; i < dataSources.getDataSource().size(); i++) {
                    DataSource ds = (DataSource)dataSources.getDataSource().get(i);
                    if (ds.isEnabled() && ds.getDriver() != null) {
                        try {
                            final String jndiName = Util.cleanJndiName(ds.getJndiName(), ds.isUseJavaContext());
                            LocalDataSourceService lds = new LocalDataSourceService(jndiName, ContextNames.bindInfoFor(jndiName));
                            lds.getDataSourceConfigInjector().inject(buildDataSource(ds));
                            final String dsName = ds.getJndiName();
                            final PathAddress addr = getDataSourceAddress(dsName, deploymentUnit, false);
                            installManagementModel(ds, deploymentUnit, addr);
                            // TODO why have we been ignoring a configured legacy security domain but no legacy security present?
                            boolean useLegacySecurity = legacySecurityPresent && isLegacySecurityRequired(ds.getSecurity());
                            startDataSource(lds, jndiName, ds.getDriver(), serviceTarget,
                                    getRegistration(false, deploymentUnit), getResource(dsName, false, deploymentUnit), dsName, useLegacySecurity, ds.isJTA(), support);
                        } catch (Exception e) {
                            throw ConnectorLogger.ROOT_LOGGER.exceptionDeployingDatasource(e, ds.getJndiName());
                        }
                    } else {
                        ConnectorLogger.DS_DEPLOYER_LOGGER.debugf("Ignoring: %s", ds.getJndiName());
                    }
                }
            }

            if (dataSources.getXaDataSource() != null && dataSources.getXaDataSource().size() > 0) {
               for (int i = 0; i < dataSources.getXaDataSource().size(); i++) {
                    XaDataSource xads = (XaDataSource)dataSources.getXaDataSource().get(i);
                    if (xads.isEnabled() && xads.getDriver() != null) {
                        try {
                            String jndiName = Util.cleanJndiName(xads.getJndiName(), xads.isUseJavaContext());
                            XaDataSourceService xds = new XaDataSourceService(jndiName, ContextNames.bindInfoFor(jndiName));
                            xds.getDataSourceConfigInjector().inject(buildXaDataSource(xads));
                            final String dsName = xads.getJndiName();
                            final PathAddress addr = getDataSourceAddress(dsName, deploymentUnit, true);
                            installManagementModel(xads, deploymentUnit, addr);
                            final Credential credential = xads.getRecovery() == null? null: xads.getRecovery().getCredential();
                            // TODO why have we been ignoring a configured legacy security domain but no legacy security present?
                            boolean useLegacySecurity = legacySecurityPresent && (isLegacySecurityRequired(xads.getSecurity())
                                                        || isLegacySecurityRequired(credential));
                            startDataSource(xds, jndiName, xads.getDriver(), serviceTarget,
                                    getRegistration(true, deploymentUnit), getResource(dsName, true, deploymentUnit), dsName, useLegacySecurity, true, support);

                        } catch (Exception e) {
                            throw ConnectorLogger.ROOT_LOGGER.exceptionDeployingDatasource(e, xads.getJndiName());
                        }
                    } else {
                        ConnectorLogger.DS_DEPLOYER_LOGGER.debugf("Ignoring %s", xads.getJndiName());
                    }
                }
            }
        }

    }
@ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final CapabilityServiceSupport support = deploymentUnit . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; final List < DataSources > dataSourcesList = deploymentUnit . getAttachmentList ( DsXmlDeploymentParsingProcessor . DATA_SOURCES_ATTACHMENT_KEY ) ; final boolean legacySecurityPresent = phaseContext . getDeploymentUnit ( ) . hasAttachment ( SecurityAttachments . SECURITY_ENABLED ) ; for ( DataSources dataSources : dataSourcesList ) { if ( dataSources . getDrivers ( ) != null && dataSources . getDrivers ( ) . size ( ) > 0 ) { ConnectorLogger . DS_DEPLOYER_LOGGER . driversElementNotSupported ( deploymentUnit . getName ( ) ) ; } ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; if ( dataSources . getDataSource ( ) != null && dataSources . getDataSource ( ) . size ( ) > 0 ) { for ( int i = 0 ; i < dataSources . getDataSource ( ) . size ( ) ; i ++ ) { DataSource ds = ( DataSource ) dataSources . getDataSource ( ) . get ( i ) ; if ( ds . isEnabled ( ) && ds . getDriver ( ) != null ) { try { final String jndiName = Util . cleanJndiName ( ds . getJndiName ( ) , ds . isUseJavaContext ( ) ) ; LocalDataSourceService lds = new LocalDataSourceService ( jndiName , ContextNames . bindInfoFor ( jndiName ) ) ; lds . getDataSourceConfigInjector ( ) . inject ( buildDataSource ( ds ) ) ; final String dsName = ds . getJndiName ( ) ; final PathAddress addr = getDataSourceAddress ( dsName , deploymentUnit , false ) ; installManagementModel ( ds , deploymentUnit , addr ) ; // TODO why have we been ignoring a configured legacy security domain but no legacy security present? boolean useLegacySecurity = legacySecurityPresent && isLegacySecurityRequired ( ds . getSecurity ( ) ) ; startDataSource ( lds , jndiName , ds . getDriver ( ) , serviceTarget , getRegistration ( false , deploymentUnit ) , getResource ( dsName , false , deploymentUnit ) , dsName , useLegacySecurity , ds . isJTA ( ) , support ) ; } catch ( Exception e ) { throw ConnectorLogger . ROOT_LOGGER . exceptionDeployingDatasource ( e , ds . getJndiName ( ) ) ; } } else { ConnectorLogger . DS_DEPLOYER_LOGGER . debugf ( "Ignoring: %s" , ds . getJndiName ( ) ) ; } } } if ( dataSources . getXaDataSource ( ) != null && dataSources . getXaDataSource ( ) . size ( ) > 0 ) { for ( int i = 0 ; i < dataSources . getXaDataSource ( ) . size ( ) ; i ++ ) { XaDataSource xads = ( XaDataSource ) dataSources . getXaDataSource ( ) . get ( i ) ; if ( xads . isEnabled ( ) && xads . getDriver ( ) != null ) { try { String jndiName = Util . cleanJndiName ( xads . getJndiName ( ) , xads . isUseJavaContext ( ) ) ; XaDataSourceService xds = new XaDataSourceService ( jndiName , ContextNames . bindInfoFor ( jndiName ) ) ; xds . getDataSourceConfigInjector ( ) . inject ( buildXaDataSource ( xads ) ) ; final String dsName = xads . getJndiName ( ) ; final PathAddress addr = getDataSourceAddress ( dsName , deploymentUnit , true ) ; installManagementModel ( xads , deploymentUnit , addr ) ; final Credential credential = xads . getRecovery ( ) == null ? null : xads . getRecovery ( ) . getCredential ( ) ; // TODO why have we been ignoring a configured legacy security domain but no legacy security present? boolean useLegacySecurity = legacySecurityPresent && ( isLegacySecurityRequired ( xads . getSecurity ( ) ) || isLegacySecurityRequired ( credential ) ) ; startDataSource ( xds , jndiName , xads . getDriver ( ) , serviceTarget , getRegistration ( true , deploymentUnit ) , getResource ( dsName , true , deploymentUnit ) , dsName , useLegacySecurity , true , support ) ; } catch ( Exception e ) { throw ConnectorLogger . ROOT_LOGGER . exceptionDeployingDatasource ( e , xads . getJndiName ( ) ) ; } } else { ConnectorLogger . DS_DEPLOYER_LOGGER . debugf ( "Ignoring %s" , xads . getJndiName ( ) ) ; } } } } }
Process a deployment for standard ra deployment files. Will parse the xml
file and attach a configuration discovered during processing.

@param phaseContext the deployment unit context
@throws DeploymentUnitProcessingException
Process a deployment for standard ra deployment files . Will parse the xml file and attach a configuration discovered during processing .