Package org.apache.felix.framework
Class BundleWiringImpl.BundleClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- org.apache.felix.framework.BundleWiringImpl.BundleClassLoader
-
- All Implemented Interfaces:
BundleReference
- Direct Known Subclasses:
BundleWiringImpl.BundleClassLoaderJava5
- Enclosing class:
- BundleWiringImpl
public static class BundleWiringImpl.BundleClassLoader extends java.security.SecureClassLoader implements BundleReference
-
-
Field Summary
Fields Modifier and Type Field Description private static int
LIBNAME_IDX
private static int
LIBPATH_IDX
private java.lang.Object[][]
m_cachedLibs
private java.util.Map<java.lang.String,java.lang.Thread>
m_classLocks
private boolean
m_isActivationTriggered
private java.util.Map
m_jarContentToDexFile
private Logger
m_logger
private BundleWiringImpl
m_wiring
-
Constructor Summary
Constructors Constructor Description BundleClassLoader(BundleWiringImpl wiring, java.lang.ClassLoader parent, Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
callWovenClassListeners(Felix felix, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClass wovenClass)
(package private) java.lang.Class
defineClass(Felix felix, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClassImpl wci, java.lang.String name, java.lang.Class clazz, byte[] bytes, Content content, java.lang.String pkgName, java.lang.Object lock)
private java.lang.Object[]
definePackage(java.lang.String pkgName)
protected java.lang.Class
findClass(java.lang.String name)
protected java.lang.String
findLibrary(java.lang.String name)
protected java.net.URL
findResource(java.lang.String name)
protected java.util.Enumeration
findResources(java.lang.String name)
BundleImpl
getBundle()
Returns theBundle
object associated with thisBundleReference
.private java.lang.Class
getDexFileClass(JarContent content, java.lang.String name, java.lang.ClassLoader loader)
java.net.URL
getResource(java.lang.String name)
boolean
isActivationTriggered()
protected boolean
isParallel()
protected java.lang.Class
loadClass(java.lang.String name, boolean resolve)
java.lang.String
toString()
(package private) void
transformClass(Felix felix, WovenClassImpl wci, java.util.Set<ServiceReference<WeavingHook>> hooks, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, java.lang.String name, byte[] bytes)
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass, getPermissions
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Field Detail
-
m_isActivationTriggered
private volatile boolean m_isActivationTriggered
-
m_jarContentToDexFile
private final java.util.Map m_jarContentToDexFile
-
m_cachedLibs
private java.lang.Object[][] m_cachedLibs
-
LIBNAME_IDX
private static final int LIBNAME_IDX
- See Also:
- Constant Field Values
-
LIBPATH_IDX
private static final int LIBPATH_IDX
- See Also:
- Constant Field Values
-
m_classLocks
private final java.util.Map<java.lang.String,java.lang.Thread> m_classLocks
-
m_wiring
private final BundleWiringImpl m_wiring
-
m_logger
private final Logger m_logger
-
-
Constructor Detail
-
BundleClassLoader
public BundleClassLoader(BundleWiringImpl wiring, java.lang.ClassLoader parent, Logger logger)
-
-
Method Detail
-
isParallel
protected boolean isParallel()
-
isActivationTriggered
public boolean isActivationTriggered()
-
getBundle
public BundleImpl getBundle()
Description copied from interface:BundleReference
Returns theBundle
object associated with thisBundleReference
.- Specified by:
getBundle
in interfaceBundleReference
- Returns:
- The
Bundle
object associated with thisBundleReference
.
-
loadClass
protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
- Overrides:
loadClass
in classjava.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
-
findClass
protected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
- Overrides:
findClass
in classjava.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
-
defineClass
java.lang.Class defineClass(Felix felix, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClassImpl wci, java.lang.String name, java.lang.Class clazz, byte[] bytes, Content content, java.lang.String pkgName, java.lang.Object lock) throws java.lang.ClassFormatError
- Throws:
java.lang.ClassFormatError
-
transformClass
void transformClass(Felix felix, WovenClassImpl wci, java.util.Set<ServiceReference<WeavingHook>> hooks, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, java.lang.String name, byte[] bytes) throws java.lang.Error
- Throws:
java.lang.Error
-
callWovenClassListeners
protected void callWovenClassListeners(Felix felix, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClass wovenClass)
-
definePackage
private java.lang.Object[] definePackage(java.lang.String pkgName)
-
getDexFileClass
private java.lang.Class getDexFileClass(JarContent content, java.lang.String name, java.lang.ClassLoader loader) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getResource
public java.net.URL getResource(java.lang.String name)
- Overrides:
getResource
in classjava.lang.ClassLoader
-
findResource
protected java.net.URL findResource(java.lang.String name)
- Overrides:
findResource
in classjava.lang.ClassLoader
-
findResources
protected java.util.Enumeration findResources(java.lang.String name)
- Overrides:
findResources
in classjava.lang.ClassLoader
-
findLibrary
protected java.lang.String findLibrary(java.lang.String name)
- Overrides:
findLibrary
in classjava.lang.ClassLoader
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-