/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache license, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the license for the specific language governing permissions and
 * limitations under the license.
 */
package org.apache.logging.log4j.core.config;

import java.io.File;
import java.util.List;

import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.util.FileWatcher;

/**
 * Watcher for configuration files. Causes a reconfiguration when a file changes.
 */
public class ConfiguratonFileWatcher implements FileWatcher {

    private final Reconfigurable reconfigurable;
    private final List<ConfigurationListener> listeners;

    public ConfiguratonFileWatcher(final Reconfigurable reconfigurable, final List<ConfigurationListener> listeners) {
        this.reconfigurable = reconfigurable;
        this.listeners = listeners;
    }

    public List<ConfigurationListener> getListeners() {
        return listeners;
    }


    @Override
    public void fileModified(final File file) {
        for (final ConfigurationListener listener : listeners) {
            LoggerContext.getContext(false).submitDaemon(new ReconfigurationWorker(listener, reconfigurable));
        }
    }

    /**
     * Helper class for triggering a reconfiguration in a background thread.
     */
    private static class ReconfigurationWorker implements Runnable {

        private final ConfigurationListener listener;
        private final Reconfigurable reconfigurable;

        public ReconfigurationWorker(final ConfigurationListener listener, final Reconfigurable reconfigurable) {
            this.listener = listener;
            this.reconfigurable = reconfigurable;
        }

        @Override
        public void run() {
            listener.onChange(reconfigurable);
        }
    }
}

@@ -1242,25 +1242,37 @@
 stener%3E 
-l
+configurationL
 istener
-s
 ;%0A%0A    p
@@ -1444,25 +1444,37 @@
    this.
-l
+configurationL
 istener
-s
  = liste
@@ -1557,25 +1557,37 @@
  return 
-l
+configurationL
 istener
-s
 ;%0A    %7D%0A
@@ -1702,25 +1702,37 @@
 tener : 
-l
+configurationL
 istener
-s
 ) %7B%0A    
@@ -1803,22 +1803,24 @@
 guration
-Worker
+Runnable
 (listene
@@ -1990,22 +1990,24 @@
 guration
-Worker
+Runnable
  impleme
@@ -2062,25 +2062,38 @@
 ionListener 
-l
+configurationL
 istener;%0A   
@@ -2177,14 +2177,16 @@
 tion
-Worker
+Runnable
 (fin
@@ -2206,25 +2206,38 @@
 ionListener 
-l
+configurationL
 istener, fin
@@ -2293,20 +2293,46 @@
 his.
-listener = l
+configurationListener = configurationL
 iste
@@ -2455,17 +2455,30 @@
         
-l
+configurationL
 istener.

Rename private class (and some private ivars).