Package org.jruby.embed.osgi.internal
Class JRubyOSGiBundleClassLoader
java.lang.Object
java.lang.ClassLoader
org.jruby.embed.osgi.internal.JRubyOSGiBundleClassLoader
- All Implemented Interfaces:
org.osgi.framework.BundleReference
public class JRubyOSGiBundleClassLoader
extends ClassLoader
implements org.osgi.framework.BundleReference
Closest thing to JRubyClassLoader's addURL but for OSGi bundles.
Used as the parent classloader the usual jruby's bundle's classloader.
- Author:
- hmalphettes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
addBundle
(org.osgi.framework.Bundle bundle) protected Class
<?> org.osgi.framework.Bundle
Returns theBundle
that defined this web-application.getResource
(String name) getResources
(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) Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
JRubyOSGiBundleClassLoader
public JRubyOSGiBundleClassLoader() -
JRubyOSGiBundleClassLoader
public JRubyOSGiBundleClassLoader(org.osgi.framework.Bundle creator)
-
-
Method Details
-
addBundle
-
addBundle
public boolean addBundle(org.osgi.framework.Bundle bundle) -
removeBundle
- Parameters:
bundle
-- Throws:
IOException
-
getBundle
public org.osgi.framework.Bundle getBundle()Returns theBundle
that defined this web-application.- Specified by:
getBundle
in interfaceorg.osgi.framework.BundleReference
- Returns:
- The
Bundle
object associated with thisBundleReference
.
-
getResources
TODO: optimize: we should not have to look for the resources everywhere until called for it.- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
getResource
- Overrides:
getResource
in classClassLoader
-
findClass
- Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-