public class AttachmentsClassLoader
A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping file paths.
Constructor and Description |
---|
AttachmentsClassLoader(java.util.List<? extends net.corda.core.contracts.Attachment> attachments,
java.lang.ClassLoader parent)
A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only
need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an
AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping
file paths.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
findClass(java.lang.String name) |
java.net.URL |
findResource(java.lang.String name) |
java.io.InputStream |
getResourceAsStream(java.lang.String name) |
public AttachmentsClassLoader(java.util.List<? extends net.corda.core.contracts.Attachment> attachments, java.lang.ClassLoader parent)
A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping file paths.