public class OsgiClassLoader extends ClassLoader implements org.hibernate.service.spi.Stoppable
Custom OSGI ClassLoader helper which knows all the "interesting" class loaders and bundles. Encapsulates the OSGi related CL capabilities.
| Constructor and Description |
|---|
OsgiClassLoader() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBundle(org.osgi.framework.Bundle bundle)
Adds a Bundle to the wrapped set of Bundles
|
void |
addClassLoader(ClassLoader classLoader)
Adds a ClassLoader to the wrapped set of ClassLoaders
|
protected Class<?> |
findClass(String name)
Load the class and break on first found match.
|
protected URL |
findResource(String name)
Load the class and break on first found match.
|
protected Enumeration<URL> |
findResources(String name)
Load the class and break on first found match.
|
void |
stop() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprotected Class<?> findClass(String name) throws ClassNotFoundException
Load the class and break on first found match.
TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi…
findClass in class ClassLoaderClassNotFoundExceptionprotected URL findResource(String name)
Load the class and break on first found match.
TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi…
findResource in class ClassLoaderprotected Enumeration<URL> findResources(String name)
Load the class and break on first found match.
Note: Since they’re Enumerations, do not cache these results!
TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi…
findResources in class ClassLoaderpublic void addClassLoader(ClassLoader classLoader)
Adds a ClassLoader to the wrapped set of ClassLoaders
classLoader - The ClassLoader to addpublic void addBundle(org.osgi.framework.Bundle bundle)
Adds a Bundle to the wrapped set of Bundles
bundle - The Bundle to addpublic void stop()
stop in interface org.hibernate.service.spi.StoppableCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.