public abstract static class AgentBuilder.BinaryLocator.WithTypePoolCache extends Object implements AgentBuilder.BinaryLocator
TypePool can grow in size and that a static reference is kept to this pool by Byte Buddy's registration of a
ClassFileTransformer what can cause a memory leak if the supplied caches are not cleared on a regular basis. Also note
that a cache provider can be accessed concurrently by multiple ClassLoaders.| Modifier and Type | Class and Description |
|---|---|
static class |
AgentBuilder.BinaryLocator.WithTypePoolCache.Simple
An implementation of a binary locator
AgentBuilder.BinaryLocator.WithTypePoolCache (note documentation of the linked class) that is based on a
ConcurrentMap. |
AgentBuilder.BinaryLocator.ClassLoading, AgentBuilder.BinaryLocator.Default, AgentBuilder.BinaryLocator.WithTypePoolCache| Modifier and Type | Field and Description |
|---|---|
protected TypePool.Default.ReaderMode |
readerMode
The reader mode to use for parsing a class file.
|
| Modifier | Constructor and Description |
|---|---|
protected |
WithTypePoolCache(TypePool.Default.ReaderMode readerMode)
Creates a new binary locator that creates
TypePools but provides a custom TypePool.CacheProvider. |
| Modifier and Type | Method and Description |
|---|---|
ClassFileLocator |
classFileLocator(ClassLoader classLoader)
Creates a class file locator for the given class loader.
|
boolean |
equals(Object object) |
int |
hashCode() |
protected abstract TypePool.CacheProvider |
locate(ClassLoader classLoader)
Locates a cache provider for a given class loader.
|
TypePool |
typePool(ClassFileLocator classFileLocator,
ClassLoader classLoader)
Creates a type pool for a given class file locator.
|
protected final TypePool.Default.ReaderMode readerMode
protected WithTypePoolCache(TypePool.Default.ReaderMode readerMode)
TypePools but provides a custom TypePool.CacheProvider.readerMode - The reader mode to use for parsing a class file.public ClassFileLocator classFileLocator(ClassLoader classLoader)
AgentBuilder.BinaryLocatorclassFileLocator in interface AgentBuilder.BinaryLocatorclassLoader - The class loader for which a class file locator should be created.
Can be null to represent the bootstrap class loader.public TypePool typePool(ClassFileLocator classFileLocator, ClassLoader classLoader)
AgentBuilder.BinaryLocatortypePool in interface AgentBuilder.BinaryLocatorclassFileLocator - The class file locator to use.classLoader - The class loader for which the class file locator was created.protected abstract TypePool.CacheProvider locate(ClassLoader classLoader)
classLoader - The class loader for which to locate a cache. This class loader might be null to represent the bootstrap loader.Copyright © 2014–2016. All rights reserved.