public void reconfigureMessaging( String etcDir, Map<String,String> msgData )
	throws IOException {

		String messagingType = msgData.get( MessagingConstants.MESSAGING_TYPE_PROPERTY );
		Logger.getLogger( getClass().getName()).fine( "Messaging type for reconfiguration: " + messagingType );
		if( ! Utils.isEmptyOrWhitespaces( etcDir )
				&& ! Utils.isEmptyOrWhitespaces( messagingType )) {

			// Write the messaging configuration
			File f = new File( etcDir, "net.roboconf.messaging." + messagingType + ".cfg" );
			Logger logger = Logger.getLogger( getClass().getName());

			Properties props = Utils.readPropertiesFileQuietly( f, logger );
			props.putAll( msgData );
			props.remove( MessagingConstants.MESSAGING_TYPE_PROPERTY );

			Utils.writePropertiesFile( props, f );

			// Set the messaging type
			f = new File( etcDir, Constants.KARAF_CFG_FILE_AGENT );

			props = Utils.readPropertiesFileQuietly( f, Logger.getLogger( getClass().getName()));
			if( messagingType != null ) {
				props.put( Constants.MESSAGING_TYPE, messagingType );
				Utils.writePropertiesFile( props, f );
			}
		}
	}
public void reconfigureMessaging ( String etcDir , Map < String , String > msgData ) throws IOException { String messagingType = msgData . get ( MessagingConstants . MESSAGING_TYPE_PROPERTY ) ; Logger . getLogger ( getClass ( ) . getName ( ) ) . fine ( "Messaging type for reconfiguration: " + messagingType ) ; if ( ! Utils . isEmptyOrWhitespaces ( etcDir ) && ! Utils . isEmptyOrWhitespaces ( messagingType ) ) { File f = new File ( etcDir , "net.roboconf.messaging." + messagingType + ".cfg" ) ; Logger logger = Logger . getLogger ( getClass ( ) . getName ( ) ) ; Properties props = Utils . readPropertiesFileQuietly ( f , logger ) ; props . putAll ( msgData ) ; props . remove ( MessagingConstants . MESSAGING_TYPE_PROPERTY ) ; Utils . writePropertiesFile ( props , f ) ; f = new File ( etcDir , Constants . KARAF_CFG_FILE_AGENT ) ; props = Utils . readPropertiesFileQuietly ( f , Logger . getLogger ( getClass ( ) . getName ( ) ) ) ; if ( messagingType != null ) { props . put ( Constants . MESSAGING_TYPE , messagingType ) ; Utils . writePropertiesFile ( props , f ) ; } } }
Reconfigures the messaging.
@param etcDir the KARAF_ETC directory
@param msgData the messaging configuration parameters