private void prepareProperties ( QName portQName , Map < String , String > serviceRefProps , Map < String , String > portProps ) throws IOException { // Merge the properties form port and service. Map < String , String > allProperties = new HashMap < String , String > ( ) ; if ( null != serviceRefProps ) { allProperties . putAll ( serviceRefProps ) ; } if ( null != portProps ) { allProperties . putAll ( portProps ) ; } for ( Map . Entry < String , String > entry : servicePidToPropertyPrefixMap . entrySet ( ) ) { String serviceFactoryPid = entry . getKey ( ) ; String prefix = entry . getValue ( ) ; // Extract the properties according to different property prefix, // update the extracted properties by corresponding factory service. Map < String , String > extractProps = extract ( prefix , allProperties ) ; // Put the port QName and the properties into the servicePropertiesMap ConfigProperties configProps = new ConfigProperties ( serviceFactoryPid , extractProps ) ; Set < ConfigProperties > configSet = servicePropertiesMap . get ( portQName ) ; if ( null == configSet ) { configSet = new HashSet < ConfigProperties > ( ) ; servicePropertiesMap . put ( portQName , configSet ) ; } if ( configSet . contains ( configProps ) ) { // re-add the config props configSet . remove ( configProps ) ; configSet . add ( configProps ) ; } else { configSet . add ( configProps ) ; } } }
merge the serviceRef properties and port properties and update the merged properties in the configAdmin service .