Package io.camunda.zeebe.util.jar
Class ExternalJarClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
io.camunda.zeebe.util.jar.ExternalJarClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
Provides a class loader which isolates external exporters from other exporters, while exposing
our own code to ensure versions match at runtime.
NOTE: if you forget to close this class loader, the underlying file is cleaned up by the
garbage collector (via Cleaner once this class loader has been garbage
collected.
If possible, it's still a good idea to close explicitly to free resources sooner and to avoid depending on undocumented behavior of a standard library class.
-
Method Summary
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Method Details
-
close
Close class loader with verbose log statement.Be aware that premature closing may lead to ClassNotFoundException.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classURLClassLoader- Throws:
IOException
-
close
Allows to close the class loader without warning statementBe aware that premature closing may lead to ClassNotFoundException.
- Throws:
IOException
-
ofPath
- Throws:
ExternalJarLoadException
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-