package org.apache.logging.log4j.core.config;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;

@Plugin(
   name = "appenders",
   category = "Core"
)
public final class AppendersPlugin {
   private AppendersPlugin() {
   }

   @PluginFactory
   public static ConcurrentMap<String, Appender> createAppenders(@PluginElement("Appenders") Appender[] appenders) {
      ConcurrentMap<String, Appender> map = new ConcurrentHashMap();
      Appender[] arr$ = appenders;
      int len$ = appenders.length;

      for(int i$ = 0; i$ < len$; ++i$) {
         Appender appender = arr$[i$];
         map.put(appender.getName(), appender);
      }

      return map;
   }
}
