@@ -0,0 +1,1525 @@
+package atg.tools.dynunit.inject;%0A%0Aimport atg.nucleus.ComponentEvent;%0Aimport atg.nucleus.ComponentListener;%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0A%0Aimport java.util.concurrent.ConcurrentHashMap;%0Aimport java.util.concurrent.ConcurrentMap;%0A%0A/**%0A * @author msicker%0A * @version 1.0.0%0A */%0Apublic class GlobalComponentRegistry%0A        implements ComponentListener %7B%0A%0A    private static final Logger logger = LogManager.getLogger();%0A    private final ConcurrentMap%3CClass%3C?%3E, Object%3E globalRegistry;%0A%0A    public GlobalComponentRegistry() %7B%0A        globalRegistry = new ConcurrentHashMap%3CClass%3C?%3E, Object%3E();%0A    %7D%0A%0A    @Override%0A    public void componentActivated(final ComponentEvent componentEvent) %7B%0A        logger.entry(componentEvent);%0A        final Object component = componentEvent.getComponent();%0A        final Class%3C?%3E klass = component.getClass();%0A        globalRegistry.putIfAbsent(klass, component);%0A        logger.exit();%0A    %7D%0A%0A    @Override%0A    public void componentDeactivated(final ComponentEvent componentEvent) %7B%0A        logger.entry(componentEvent);%0A        final Object component = componentEvent.getComponent();%0A        globalRegistry.remove(component.getClass());%0A        logger.exit();%0A    %7D%0A%0A    public Object getComponentForClass(final Class%3C?%3E componentClass) %7B%0A        return globalRegistry.get(componentClass);%0A    %7D%0A%0A    public boolean isComponentRegistered(final Class%3C?%3E componentClass) %7B%0A        return globalRegistry.containsKey(componentClass);%0A    %7D%0A%7D%0A

Add global component registry.