Package net.bytebuddy.agent.builder
Interface AgentBuilder.ClassFileBufferStrategy
-
- All Known Implementing Classes:
AgentBuilder.ClassFileBufferStrategy.Default
- Enclosing interface:
- AgentBuilder
public static interface AgentBuilder.ClassFileBufferStrategy
This strategy determines how the provided class file buffer is used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AgentBuilder.ClassFileBufferStrategy.Default
An implementation of default class file buffer strategy.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassFileLocator
resolve(java.lang.String name, byte[] binaryRepresentation, java.lang.ClassLoader classLoader, JavaModule module, java.security.ProtectionDomain protectionDomain)
Resolves a class file locator for the class file buffer that is provided to the class file transformer.TypePool
typePool(AgentBuilder.PoolStrategy poolStrategy, ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader, java.lang.String name)
Resolves the type pool for a given type name by the suppliedAgentBuilder.PoolStrategy
.
-
-
-
Method Detail
-
resolve
ClassFileLocator resolve(java.lang.String name, byte[] binaryRepresentation, java.lang.ClassLoader classLoader, JavaModule module, java.security.ProtectionDomain protectionDomain)
Resolves a class file locator for the class file buffer that is provided to the class file transformer.- Parameters:
name
- The instrumented type's binary name.binaryRepresentation
- The instrumented type's binary representation.classLoader
- The instrumented type's class loader ornull
if the type is loaded by the bootstrap class loader.module
- The instrumented type's module ornull
if the current VM does not support modules.protectionDomain
- The instrumented type's protection domain.- Returns:
- An appropriate class file locator.
-
typePool
TypePool typePool(AgentBuilder.PoolStrategy poolStrategy, ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader, java.lang.String name)
Resolves the type pool for a given type name by the suppliedAgentBuilder.PoolStrategy
.- Parameters:
poolStrategy
- The pool strategy to use.classFileLocator
- The class file locator to use.classLoader
- The class loader to use.name
- The name of the type for which the type pool is resolved.- Returns:
- A suitable type pool.
-
-