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 intLIBNAME_IDXprivate static intLIBPATH_IDXprivate java.lang.Object[][]m_cachedLibsprivate java.util.Map<java.lang.String,java.lang.Thread>m_classLocksprivate booleanm_isActivationTriggeredprivate java.util.Mapm_jarContentToDexFileprivate Loggerm_loggerprivate BundleWiringImplm_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 voidcallWovenClassListeners(Felix felix, java.util.Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClass wovenClass)(package private) java.lang.ClassdefineClass(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.ClassfindClass(java.lang.String name)protected java.lang.StringfindLibrary(java.lang.String name)protected java.net.URLfindResource(java.lang.String name)protected java.util.EnumerationfindResources(java.lang.String name)BundleImplgetBundle()Returns theBundleobject associated with thisBundleReference.private java.lang.ClassgetDexFileClass(JarContent content, java.lang.String name, java.lang.ClassLoader loader)java.net.URLgetResource(java.lang.String name)booleanisActivationTriggered()protected booleanisParallel()protected java.lang.ClassloadClass(java.lang.String name, boolean resolve)java.lang.StringtoString()(package private) voidtransformClass(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:BundleReferenceReturns theBundleobject associated with thisBundleReference.- Specified by:
getBundlein interfaceBundleReference- Returns:
- The
Bundleobject associated with thisBundleReference.
-
loadClass
protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException- Overrides:
loadClassin classjava.lang.ClassLoader- Throws:
java.lang.ClassNotFoundException
-
findClass
protected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException- Overrides:
findClassin 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:
getResourcein classjava.lang.ClassLoader
-
findResource
protected java.net.URL findResource(java.lang.String name)
- Overrides:
findResourcein classjava.lang.ClassLoader
-
findResources
protected java.util.Enumeration findResources(java.lang.String name)
- Overrides:
findResourcesin classjava.lang.ClassLoader
-
findLibrary
protected java.lang.String findLibrary(java.lang.String name)
- Overrides:
findLibraryin classjava.lang.ClassLoader
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-