public synchronized void modified ( Properties props ) { for ( Object key : props . keySet ( ) ) { String msgId = ( String ) key ; String logHandlerIds = props . getProperty ( msgId ) ; Set < String > logHandlerIdSet = getOrCreateLogHandlerIdSet ( msgId ) ; // "logHandlerIds" is a comma-separated list of LogHandlers IDs. Each LogHandler ID // may contain a +/- char in front, to indicate that the LogHandler should be // added/removed to/from the list for this msgId. If the +/- is not specified, // assume +. for ( String id : split ( logHandlerIds , "," ) ) { // Protect against bad input, such as empty IDs. id = id . trim ( ) ; if ( id . length ( ) > 0 ) { // Check for the +/- in first char. char plusOrMinus = id . charAt ( 0 ) ; if ( plusOrMinus != ' ' && plusOrMinus != ' ' ) { plusOrMinus = ' ' ; // + by default. } else { id = id . substring ( 1 ) ; // skip over the +/-. } // Make sure there's still something left after stripping off the +/-. if ( id . length ( ) > 0 ) { if ( plusOrMinus == ' ' ) { logHandlerIdSet . add ( id ) ; } else { // '-' means remove. logHandlerIdSet . remove ( id ) ; } } } } if ( logHandlerIdSet . size ( ) == 1 && logHandlerIdSet . contains ( "DEFAULT" ) ) { // No entries (other than default) for this msgId. Remove it from the map. msgIdToLogHandlerIds . remove ( msgId ) ; } } }
Process the MessageRouter . properties file contents given by the Properties parm .