public class InstrumentationLoaderClassProvider extends java.lang.Object implements ClassProvider, java.lang.instrument.ClassFileTransformer
Instrumentation instance to collect all class loaders to provide classes.LoaderClassProvider instances for each found class loader.LoaderClassProviderClassProvider.ClassSupplier| Constructor and Description |
|---|
InstrumentationLoaderClassProvider(java.lang.instrument.Instrumentation instrumentation) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the class provider and free all resources.
|
java.util.Map<java.lang.String,ClassProvider.ClassSupplier> |
getAllClasses()
Get a map of all classes that are available in this provider.
|
byte[] |
getClass(java.lang.String name)
Get the bytecode of a class by its name.
|
byte[] |
transform(java.lang.ClassLoader loader,
java.lang.String className,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassNode, thenpublic InstrumentationLoaderClassProvider(java.lang.instrument.Instrumentation instrumentation)
@Nonnull
public byte[] getClass(java.lang.String name)
throws java.lang.ClassNotFoundException
ClassProvider"package/Name".ClassNotFoundException is thrown.getClass in interface ClassProvidername - The name of the classjava.lang.ClassNotFoundException - If the class could not be found@Nonnull public java.util.Map<java.lang.String,ClassProvider.ClassSupplier> getAllClasses() throws java.lang.UnsupportedOperationException
ClassProviderUnsupportedOperationException if it is not supported."package/Name".getAllClasses in interface ClassProviderjava.lang.UnsupportedOperationException - If this operation is not supportedpublic void close()
throws java.lang.Exception
ClassProviderclose in interface java.lang.AutoCloseableclose in interface ClassProviderjava.lang.Exception - If an error occurred while closing the class providerpublic byte[] transform(java.lang.ClassLoader loader,
java.lang.String className,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain,
byte[] classfileBuffer)
transform in interface java.lang.instrument.ClassFileTransformer