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 TypeMethodDescriptionvoidbooleanaddBundle(org.osgi.framework.Bundle bundle) protected Class<?> org.osgi.framework.BundleReturns theBundlethat 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.booleanremoveBundle(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 theBundlethat defined this web-application.- Specified by:
getBundlein interfaceorg.osgi.framework.BundleReference- Returns:
- The
Bundleobject associated with thisBundleReference.
-
getResources
TODO: optimize: we should not have to look for the resources everywhere until called for it.- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-
getResource
- Overrides:
getResourcein classClassLoader
-
findClass
- Overrides:
findClassin classClassLoader- Throws:
ClassNotFoundException
-