public class JRubyOSGiBundleClassLoader
extends java.lang.ClassLoader
implements org.osgi.framework.BundleReference
| Modifier and Type | Field and Description |
|---|---|
private java.util.LinkedHashMap<org.osgi.framework.Bundle,java.lang.ClassLoader> |
_libraries |
private boolean |
_lookInOsgiFirst
look in OSGi first? true by default for now.
|
private static IOSGiClassLoaderAdapter |
ADAPTER |
private static Logger |
LOG |
| Constructor and Description |
|---|
JRubyOSGiBundleClassLoader() |
JRubyOSGiBundleClassLoader(org.osgi.framework.Bundle creator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addBundle(org.osgi.framework.Bundle bundle) |
void |
addBundle(java.lang.Class<?> classInOsgiBundle) |
protected java.lang.Class<?> |
findClass(java.lang.String name) |
org.osgi.framework.Bundle |
getBundle()
Returns the
Bundle that defined this web-application. |
java.net.URL |
getResource(java.lang.String name) |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name)
TODO: optimize: we should not have to look for the resources everywhere
until called for it.
|
boolean |
removeBundle(org.osgi.framework.Bundle bundle) |
private java.util.List<java.net.URL> |
toList(java.util.List<java.util.Enumeration<java.net.URL>> l) |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprivate static final Logger LOG
private static final IOSGiClassLoaderAdapter ADAPTER
private boolean _lookInOsgiFirst
private java.util.LinkedHashMap<org.osgi.framework.Bundle,java.lang.ClassLoader> _libraries
public JRubyOSGiBundleClassLoader()
java.io.IOExceptionpublic JRubyOSGiBundleClassLoader(org.osgi.framework.Bundle creator)
java.io.IOExceptionpublic void addBundle(java.lang.Class<?> classInOsgiBundle)
java.io.IOExceptionpublic boolean addBundle(org.osgi.framework.Bundle bundle)
parent - The parent classloader. In this case jrubyLoadercontext - The WebAppContextcontributor - The bundle that defines this web-application.java.io.IOExceptionpublic boolean removeBundle(org.osgi.framework.Bundle bundle)
throws java.io.IOException
parent - The parent classloader. In this case jrubyLoadercontext - The WebAppContextcontributor - The bundle that defines this web-application.java.io.IOExceptionpublic org.osgi.framework.Bundle getBundle()
Bundle that defined this web-application.getBundle in interface org.osgi.framework.BundleReferenceBundle object associated with this
BundleReference.public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
throws java.io.IOException
getResources in class java.lang.ClassLoaderjava.io.IOExceptionpublic java.net.URL getResource(java.lang.String name)
getResource in class java.lang.ClassLoaderprivate java.util.List<java.net.URL> toList(java.util.List<java.util.Enumeration<java.net.URL>> l)
protected java.lang.Class<?> findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundException