private final void parseTargetSpecificSettings ( final Element root ) { final NodeList targets = root . getElementsByTagName ( ELEMENT_TARGET ) ; Node target ; Node parameter ; NodeList parameters ; try { for ( int i = 0 ; i < targets . getLength ( ) ; i ++ ) { target = targets . item ( i ) ; parameters = target . getChildNodes ( ) ; // extract target address and the port (if specified) SessionConfiguration sc = new SessionConfiguration ( ) ; sc . setAddress ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_ADDRESS ) . getNodeValue ( ) , Integer . parseInt ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_PORT ) . getNodeValue ( ) ) ) ; // extract the parameters for this target for ( int j = 0 ; j < parameters . getLength ( ) ; j ++ ) { parameter = parameters . item ( j ) ; if ( parameter . getNodeType ( ) == Node . ELEMENT_NODE ) { sc . addSessionSetting ( OperationalTextKey . valueOfEx ( parameter . getNodeName ( ) ) , parameter . getTextContent ( ) ) ; } } synchronized ( sessionConfigs ) { sessionConfigs . put ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_ID ) . getNodeValue ( ) , sc ) ; } } } catch ( UnknownHostException e ) { if ( LOGGER . isErrorEnabled ( ) ) { LOGGER . error ( "The given host is not reachable: " + e . getLocalizedMessage ( ) ) ; } } }
Parses all target - specific settings form the main configuration file .