public static class ClassFileLocator.AgentBased extends Object implements ClassFileLocator
| Modifier and Type | Class and Description |
|---|---|
static interface |
ClassFileLocator.AgentBased.ClassLoadingDelegate
A delegate that is queried for loading a class.
|
protected static class |
ClassFileLocator.AgentBased.ExtractionClassFileTransformer
A non-operational class file transformer that remembers the binary format of a given class.
|
ClassFileLocator.AgentBased, ClassFileLocator.Compound, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.SimpleCLASS_FILE_EXTENSION| Constructor and Description |
|---|
AgentBased(Instrumentation instrumentation,
ClassFileLocator.AgentBased.ClassLoadingDelegate classLoadingDelegate)
Creates an agent-based class file locator.
|
AgentBased(Instrumentation instrumentation,
ClassLoader classLoader)
Creates an agent-based class file locator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static ClassFileLocator |
fromInstalledAgent(ClassLoader classLoader)
Returns an agent-based class file locator for the given class loader and an already installed
Byte Buddy-agent.
|
ClassFileLocator.Resolution |
locate(String typeName)
Locates the class file for a given type and returns the binary data of the class file.
|
static ClassFileLocator |
of(Instrumentation instrumentation,
Class<?> type)
Returns a class file locator that is capable of locating a class file for the given type using the given instrumentation instance.
|
public AgentBased(Instrumentation instrumentation, ClassLoader classLoader)
instrumentation - The instrumentation to be used.classLoader - The class loader to read a class from.public AgentBased(Instrumentation instrumentation, ClassFileLocator.AgentBased.ClassLoadingDelegate classLoadingDelegate)
instrumentation - The instrumentation to be used.classLoadingDelegate - The delegate responsible for class loading.public static ClassFileLocator fromInstalledAgent(ClassLoader classLoader)
classLoader - The class loader that is expected to load the looked-up a class.public static ClassFileLocator of(Instrumentation instrumentation, Class<?> type)
instrumentation - The instrumentation instance to query for a retransformation.type - The locatable type which class loader is used as a fallback.public ClassFileLocator.Resolution locate(String typeName)
ClassFileLocatorlocate in interface ClassFileLocatortypeName - The name of the type to locate a class file representation for.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2014–2018. All rights reserved.