Package org.eclipse.jetty.osgi.util
Interface BundleClassLoaderHelper
- All Known Implementing Classes:
DefaultBundleClassLoaderHelper
public interface BundleClassLoaderHelper
BundleClassLoaderHelper
Provides a ClassLoader for an OSGi Bundle.
The default implementation uses a specification-compliant approach that delegates to the standard OSGi Bundle API methods (Bundle.loadClass, Bundle.getResource, Bundle.getResources) instead of using reflection to access container-specific internal classloaders.
Custom implementations can be provided via OSGi fragments by implementing
a class with the name specified by CLASS_NAME.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the custom implementation for this interface in a fragment.static final BundleClassLoaderHelperThe default instance uses specification-compliant OSGi APIs -
Method Summary
Modifier and TypeMethodDescriptiongetBundleClassLoader(org.osgi.framework.Bundle bundle) Returns a ClassLoader for the given bundle that can be used to load classes and resources from the bundle.
-
Field Details
-
CLASS_NAME
The name of the custom implementation for this interface in a fragment.- See Also:
-
DEFAULT
The default instance uses specification-compliant OSGi APIs
-
-
Method Details
-
getBundleClassLoader
Returns a ClassLoader for the given bundle that can be used to load classes and resources from the bundle.- Parameters:
bundle- the bundle- Returns:
- a ClassLoader for the bundle
-