Class PluginRegistry
java.lang.Object
org.apache.logging.log4j.core.config.plugins.util.PluginRegistry
Registry singleton for PluginType maps partitioned by source type and then by category names.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A Test that checks to see if each class is annotated with the 'Plugin' annotation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static PluginRegistry
private static final Object
private static final Logger
private final ConcurrentMap<Long,
Map<String, List<PluginType<?>>>> Contains plugins found in Log4j2Plugins.dat cache files in OSGi Bundles.private final ConcurrentMap<String,
Map<String, List<PluginType<?>>>> Contains plugins found by searching for annotated classes at runtime.private final AtomicReference<Map<String,
List<PluginType<?>>>> Contains plugins found in Log4j2Plugins.dat cache files in the main CLASSPATH. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Resets the registry to an empty state.void
clearBundlePlugins
(long bundleId) private Map<String,
List<PluginType<?>>> decodeCacheFiles
(ClassLoader loader) static PluginRegistry
Returns the global PluginRegistry instance.Map<String,
List<PluginType<?>>> loadFromBundle
(long bundleId, ClassLoader loader) Map<String,
List<PluginType<?>>> Map<String,
List<PluginType<?>>> loadFromPackage
(String pkg)
-
Field Details
-
LOGGER
-
INSTANCE
-
INSTANCE_LOCK
-
pluginsByCategoryRef
Contains plugins found in Log4j2Plugins.dat cache files in the main CLASSPATH. -
pluginsByCategoryByBundleId
Contains plugins found in Log4j2Plugins.dat cache files in OSGi Bundles. -
pluginsByCategoryByPackage
Contains plugins found by searching for annotated classes at runtime.
-
-
Constructor Details
-
PluginRegistry
private PluginRegistry()
-
-
Method Details
-
getInstance
Returns the global PluginRegistry instance.- Returns:
- the global PluginRegistry instance.
- Since:
- 2.1
-
clear
public void clear()Resets the registry to an empty state. -
getPluginsByCategoryByBundleId
- Since:
- 2.1
-
loadFromMainClassLoader
- Since:
- 2.1
-
clearBundlePlugins
public void clearBundlePlugins(long bundleId) - Since:
- 2.1
-
loadFromBundle
- Since:
- 2.1
-
decodeCacheFiles
-
loadFromPackage
- Since:
- 2.1
-