Class HelperClassManager.ForAnyClassLoader<T>

  • Type Parameters:
    T -
    Enclosing class:
    HelperClassManager<T>

    @Deprecated
    public static class HelperClassManager.ForAnyClassLoader<T>
    extends HelperClassManager<T>
    Deprecated.
    Use indy plugins instead. As the whole package the indy plugin is defined it is loaded from IndyPluginClassLoader, a separate helper class manager is not needed anymore.
    This helper class manager is for usage of confined context class loaders, like web app class loaders. It injects a minimal class to the target class loader and keeps loaded helper instances in a static field of that class. This way, helper instances have a hard reference as long as the class loader is alive, when they become GC-eligible, that without holding hard references to the class loader or any of the user/library classes. This manager supports multiple helpers for each class loader through a list of hard references held statically by the injected class. Failures in helper class loading are cached so that no loading attempts will be made over and over. In order to optimize performance, stale entries are removed only when new helpers are being loaded (normally at the beginning of startup time and when new applications are deployed). These maps shouldn't grow big as they have an entry per class loader.
    • Method Detail

      • doGetForClassLoaderOfClass

        @Nullable
        public T doGetForClassLoaderOfClass​(java.lang.Class<?> classOfTargetClassLoader)
                                     throws java.lang.Exception
        Deprecated.
        Description copied from class: HelperClassManager
        Implementations of this method are expected to load helper classes lazily, meaning when invoked for the first time. By delaying the helper class loading only to when actually required (normally from the injected code) we ensure proper classpath is already in place.
        Specified by:
        doGetForClassLoaderOfClass in class HelperClassManager<T>
        Parameters:
        classOfTargetClassLoader - a class loaded by the class loader we want to load the helper class from
        Returns:
        helper instance
        Throws:
        java.lang.Exception - most likely related to first time loading error