Package co.elastic.apm.agent.bci
Class HelperClassManager.ForAnyClassLoader<T>
- java.lang.Object
-
- co.elastic.apm.agent.bci.HelperClassManager<T>
-
- co.elastic.apm.agent.bci.HelperClassManager.ForAnyClassLoader<T>
-
- Type Parameters:
T-
- Enclosing class:
- HelperClassManager<T>
@Deprecated public static class HelperClassManager.ForAnyClassLoader<T> extends HelperClassManager<T>
Deprecated.Useindy pluginsinstead. As the whole package the indy plugin is defined it is loaded fromIndyPluginClassLoader, 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class co.elastic.apm.agent.bci.HelperClassManager
HelperClassManager.ForAnyClassLoader<T>, HelperClassManager.ForSingleClassLoader<T>
-
-
Field Summary
-
Fields inherited from class co.elastic.apm.agent.bci.HelperClassManager
additionalHelpers, implementation, tracer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TdoGetForClassLoaderOfClass(java.lang.Class<?> classOfTargetClassLoader)Deprecated.Implementations of this method are expected to load helper classes lazily, meaning when invoked for the first time.static <T> HelperClassManager.ForAnyClassLoader<T>of(ElasticApmTracer tracer, java.lang.String implementation, java.lang.String... additionalHelpers)Deprecated.Not loading and instantiating helper class yet, just prepares the manager-
Methods inherited from class co.elastic.apm.agent.bci.HelperClassManager
getForClassLoaderOfClass
-
-
-
-
Method Detail
-
of
public static <T> HelperClassManager.ForAnyClassLoader<T> of(ElasticApmTracer tracer, java.lang.String implementation, java.lang.String... additionalHelpers)
Deprecated.Not loading and instantiating helper class yet, just prepares the manager
-
doGetForClassLoaderOfClass
@Nullable public T doGetForClassLoaderOfClass(java.lang.Class<?> classOfTargetClassLoader) throws java.lang.Exception
Deprecated.Description copied from class:HelperClassManagerImplementations 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:
doGetForClassLoaderOfClassin classHelperClassManager<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
-
-