private void configureJMSConnectionFactories(List<JMSConnectionFactory> jmsConnFactories) {
        
        Map<String, ConfigItem<JMSConnectionFactory>> jmsCfConfigItemMap = configurator.getConfigItemMap(JNDIEnvironmentRefType.JMSConnectionFactory.getXMLElementName());
        
        for (JMSConnectionFactory jmsConnFactory : jmsConnFactories) {
            String name = jmsConnFactory.getName();
            if (name == null) {
                continue;
            }
            ConfigItem<JMSConnectionFactory> existedCF = jmsCfConfigItemMap.get(name);
            if (existedCF == null) {
                jmsCfConfigItemMap.put(name, createConfigItem(jmsConnFactory, JMS_CF_COMPARATOR));
                webAppConfiguration.addRef(JNDIEnvironmentRefType.JMSConnectionFactory, jmsConnFactory);
            } else {
                if (existedCF.getSource() == ConfigSource.WEB_XML && configurator.getConfigSource() == ConfigSource.WEB_FRAGMENT) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "{0}.{1} with value {2}  is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored", JNDIEnvironmentRefType.JMSConnectionFactory.getXMLElementName(), "name",
                                 existedCF.getValue(), name, configurator.getLibraryURI());
                    }
                } else if (existedCF.getSource() == ConfigSource.WEB_FRAGMENT && configurator.getConfigSource() == ConfigSource.WEB_FRAGMENT
                           && !existedCF.compareValue(jmsConnFactory)) {
                    configurator.addErrorMessage(nls.getFormattedMessage("CONFLICT_JMS_CONNECTION_FACTORY_REFERENCE_BETWEEN_WEB_FRAGMENT_XML",
                                                                         new Object[] { name,
                                                                                        existedCF.getLibraryURI(),
                                                                                       this.configurator.getLibraryURI() },
                                                                         "Two "+JNDIEnvironmentRefType.JMSConnectionFactory.getXMLElementName()+" configurations with the same name {0} found in the web-fragment.xml of {1} and {2}."));
                }
            }
        }
    }
private void configureJMSConnectionFactories ( List < JMSConnectionFactory > jmsConnFactories ) { Map < String , ConfigItem < JMSConnectionFactory > > jmsCfConfigItemMap = configurator . getConfigItemMap ( JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) ) ; for ( JMSConnectionFactory jmsConnFactory : jmsConnFactories ) { String name = jmsConnFactory . getName ( ) ; if ( name == null ) { continue ; } ConfigItem < JMSConnectionFactory > existedCF = jmsCfConfigItemMap . get ( name ) ; if ( existedCF == null ) { jmsCfConfigItemMap . put ( name , createConfigItem ( jmsConnFactory , JMS_CF_COMPARATOR ) ) ; webAppConfiguration . addRef ( JNDIEnvironmentRefType . JMSConnectionFactory , jmsConnFactory ) ; } else { if ( existedCF . getSource ( ) == ConfigSource . WEB_XML && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "{0}.{1} with value {2}  is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored" , JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) , "name" , existedCF . getValue ( ) , name , configurator . getLibraryURI ( ) ) ; } } else if ( existedCF . getSource ( ) == ConfigSource . WEB_FRAGMENT && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT && ! existedCF . compareValue ( jmsConnFactory ) ) { configurator . addErrorMessage ( nls . getFormattedMessage ( "CONFLICT_JMS_CONNECTION_FACTORY_REFERENCE_BETWEEN_WEB_FRAGMENT_XML" , new Object [ ] { name , existedCF . getLibraryURI ( ) , this . configurator . getLibraryURI ( ) } , "Two " + JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) + " configurations with the same name {0} found in the web-fragment.xml of {1} and {2}." ) ) ; } } } }
To configure JMS ConnectionFactory
@param jmsConnFactories