Class PluginMapFactoryResolver<T>

java.lang.Object
org.apache.logging.log4j.plugins.di.resolver.AbstractPluginFactoryResolver<Map<String,? extends T>>
org.apache.logging.log4j.plugins.di.resolver.PluginMapFactoryResolver<T>
All Implemented Interfaces:
FactoryResolver<Map<String,? extends T>>

public class PluginMapFactoryResolver<T> extends AbstractPluginFactoryResolver<Map<String,? extends T>>
Factory resolver for Map<String, T> of plugin instances or factories keyed by plugin name within a namespace. Value types can be Supplier<T> to inject plugin factories instead of plugin instances.
  • Constructor Details

    • PluginMapFactoryResolver

      public PluginMapFactoryResolver()
  • Method Details

    • supportsType

      protected boolean supportsType(Type rawType, Type... typeArguments)
      Specified by:
      supportsType in class AbstractPluginFactoryResolver<Map<String,? extends T>>
    • getFactory

      public Supplier<Map<String,? extends T>> getFactory(ResolvableKey<Map<String,? extends T>> resolvableKey, InstanceFactory instanceFactory)
      Description copied from interface: FactoryResolver
      Gets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is a Key combined with alias names and the annotated element this factory is for.
      Parameters:
      resolvableKey - the resolvable key to create a binding for
      instanceFactory - the existing instance factory to use for composing bindings
      Returns:
      a factory for instances described by the provided key