akka.osgi
Class BundleDelegatingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by akka.osgi.BundleDelegatingClassLoader

public class BundleDelegatingClassLoader
extends java.lang.ClassLoader

A bundle delegating ClassLoader implementation - this will try to load classes and resources from the bundle and the bundles transitive dependencies. If there's a ClassLoader specified, that will be used as a fallback.


Constructor Summary
BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle, java.lang.ClassLoader fallBackClassLoader)
           
 
Method Summary
static BundleDelegatingClassLoader apply(org.osgi.framework.BundleContext context)
          Create a bundle delegating ClassLoader for the bundle context's bundle
static BundleDelegatingClassLoader apply(org.osgi.framework.BundleContext context, scala.Option<java.lang.ClassLoader> fallBackCLassLoader)
           
 java.lang.Class<?> findClass(java.lang.String name)
           
 java.net.URL findResource(java.lang.String name)
           
 java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleDelegatingClassLoader

public BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle,
                                   java.lang.ClassLoader fallBackClassLoader)
Method Detail

apply

public static BundleDelegatingClassLoader apply(org.osgi.framework.BundleContext context)
Create a bundle delegating ClassLoader for the bundle context's bundle


apply

public static BundleDelegatingClassLoader apply(org.osgi.framework.BundleContext context,
                                                scala.Option<java.lang.ClassLoader> fallBackCLassLoader)

findClass

public java.lang.Class<?> findClass(java.lang.String name)
Overrides:
findClass in class java.lang.ClassLoader

findResource

public java.net.URL findResource(java.lang.String name)
Overrides:
findResource in class java.lang.ClassLoader

findResources

public java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
Overrides:
findResources in class java.lang.ClassLoader