A java. that is capable of loading explicitly defined classes. The class loader will free
any binary resources once a class that is defined by its binary data is loaded. This class loader is thread safe since
the class loading mechanics are only called from synchronized context.
Note
Instances of this class loader return URLs for their represented class loaders with the bytebuddy schema. These URLs do not represent URIs as two classes with the same name yield identical URLs but might represents different byte arrays.
Note
Any class and package definition is performed using the creator's java.security.AccessControlContext.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ByteArrayClassLoader.ChildFirst
A |
| protected class | ByteArrayClassLoader.ClassDefinitionAction
An action for defining a located class that is not yet loaded. |
| protected static enum | ByteArrayClassLoader.EmptyEnumeration
An enumeration without any elements. |
| protected static interface | ByteArrayClassLoader.PackageLookupStrategy
A package lookup strategy for locating a package by name. |
| public static enum | ByteArrayClassLoader.PersistenceHandler
A persistence handler decides on whether the byte array that represents a loaded class is exposed by
the |
| protected static class | ByteArrayClassLoader.SingletonEnumeration
An enumeration that contains a single element. |
| protected static interface | ByteArrayClassLoader.SynchronizationStrategy
An engine for receiving a class loading lock when loading a class. |
| Modifier and Type | Field and Description |
|---|---|
| protected final Object | accessControlContext
The access control context to use for loading classes or |
| protected final ClassFilePostProcessor | classFilePostProcessor
The class file transformer to apply on loaded classes. |
| private static final int | FROM_BEGINNING
Indicates that an array should be included from its first index. |
| private static final URL | NO_URL
Indicates that a URL does not exist to improve code readability. |
| private static final ByteArrayClassLoader. | PACKAGE_LOOKUP_STRATEGY
A strategy for locating a package by name. |
| protected final PackageDefinitionStrategy | packageDefinitionStrategy
The package definer to be queried for package definitions. |
| protected final ByteArrayClassLoader. | persistenceHandler
The persistence handler of this class loader. |
| protected final ProtectionDomain | protectionDomain
The protection domain to apply. |
| protected static final ByteArrayClassLoader. | SYNCHRONIZATION_STRATEGY
The synchronization engine for the executing JVM. |
| protected final ConcurrentMap | typeDefinitions
A mutable map of type names mapped to their binary representation. |
| public static final String | URL_SCHEMA
The schema for URLs that represent a class file of byte array class loaders. |
| Access | Constructor and Description |
|---|---|
| public | ByteArrayClassLoader(ClassLoader
The parent, Map<String, byte[]> java. that is the parent of this class loader.A map of fully qualified class names pointing to their binary representations. typeDefinitions)Creates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, boolean java. that is the parent of this class loader.true if this class loader is sealed.A map of fully qualified class names pointing to their binary representations. typeDefinitions)Creates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, Map<String, byte[]> java. that is the parent of this class loader.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ByteArrayClassLoader.The persistence handler of this class loader. persistenceHandlerCreates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, boolean java. that is the parent of this class loader.true if this class loader is sealed.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ByteArrayClassLoader.The persistence handler of this class loader. persistenceHandlerCreates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, Map<String, byte[]> java. that is the parent of this class loader.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ProtectionDomain The protection domain to apply where protectionDomain, ByteArrayClassLoader.null references an implicit protection domain.The persistence handler of this class loader. persistenceHandler,The package definer to be queried for package definitions. packageDefinitionStrategy)Creates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, boolean java. that is the parent of this class loader.true if this class loader is sealed.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ProtectionDomain The protection domain to apply where protectionDomain, ByteArrayClassLoader.null references an implicit protection domain.The persistence handler of this class loader. persistenceHandler,The package definer to be queried for package definitions. packageDefinitionStrategy)Creates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, Map<String, byte[]> java. that is the parent of this class loader.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ProtectionDomain The protection domain to apply where protectionDomain, ByteArrayClassLoader.null references an implicit protection domain.The persistence handler of this class loader. persistenceHandler,The package definer to be queried for package definitions. packageDefinitionStrategy, ClassFilePostProcessor A post processor for class files to apply p classFilePostProcessor)Creates a new class loader for a given definition of classes. |
| public | ByteArrayClassLoader(ClassLoader
The parent, boolean java. that is the parent of this class loader.true if this class loader is sealed.A map of fully qualified class names pointing to their binary representations. typeDefinitions, ProtectionDomain The protection domain to apply where protectionDomain, ByteArrayClassLoader.null references an implicit protection domain.The persistence handler of this class loader. persistenceHandler,The package definer to be queried for package definitions. packageDefinitionStrategy, ClassFilePostProcessor A post processor for class files to apply p classFilePostProcessor)Creates a new class loader for a given definition of classes. |
| Modifier and Type | Method and Description |
|---|---|
| protected Map | doDefineClasses(Map<String, byte[]>
The types binary representations. typeDefinitions)Implements abstract net. |
| private Package | Returns: A suitable package ornull if no such package exists.The name of the package. name)Returns the package for a given name. |
| private static < The type of the action's resolved value. T> T | Returns: The action's resolved value.The action to execute from a privileged context. action)A proxy for |
| private static < The type of the action's resolved value. T> T | Returns: The action's resolved value.The action to execute from a privileged context. action, Object The access control context or context)null if the current VM does not support it.A proxy for |
| private static void | doRegisterAsParallelCapable()
Hides net. |
| protected Class | findClass(String
The binary name of the class name)Overrides java. |
| protected URL | findResource(String
The resource name name)Overrides java. |
| protected Enumeration | findResources(String
The resource name name)Overrides java. URL objects
representing all the resources with the given name.
|
| private static Object | Returns: The current access control context ornull if the current VM does not support it.A proxy for |
| public static Map | Returns: A map of the given type descriptions pointing to their loaded representations.The parent class loader. classLoader, Map<TypeDescription, byte[]> The unloaded types to be loaded. types)Loads a given set of class descriptions and their binary representations. |
| public static Map | Returns: A map of the given type descriptions pointing to their loaded representations.The parent class loader. classLoader, Map<TypeDescription, byte[]> The unloaded types to be loaded. types, ProtectionDomain The protection domain to apply where protectionDomain, ByteArrayClassLoader.null references an implicit protection domain.The persistence handler of the created class loader. persistenceHandler,The package definer to be queried for package definitions. packageDefinitionStrategy, boolean true if the class loading should throw an exception if a class was already loaded by a parent class loader.true if the class loader should be sealed.Loads a given set of class descriptions and their binary representations. |
| private static Object | Returns: A method handle for this class.Resolves a method handle in the scope of the |