Package i5.las2peer.classLoaders
Class ServiceClassLoader
java.lang.Object
java.lang.ClassLoader
i5.las2peer.classLoaders.ServiceClassLoader
A service class loader is responsible for loading classes from the service bundle, probably loaded via a
Repository
-
Constructor Summary
ConstructorDescriptionServiceClassLoader
(LoadedLibrary lib, ClassLoader parent, ClassLoaderPolicy policy) create a new class loader for a given library. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>
get the library this loader is responsible forgetResource
(String resourceName) get the URL for a resourceprotected Class<?>
loading classes in a Library class loader follows the following steps: check if the class has already been loaded look into all bundles class loaders this library class loader has been registered to look into the bootstrap class loader alert that the class cannot be foundMethods 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, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ServiceClassLoader
create a new class loader for a given library.- Parameters:
lib
- A library to load service classes fromparent
- A parent class loaderpolicy
- A class loader policy
-
-
Method Details
-
findClass
- Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-
loadClass
loading classes in a Library class loader follows the following steps: check if the class has already been loaded look into all bundles class loaders this library class loader has been registered to look into the bootstrap class loader alert that the class cannot be found- Overrides:
loadClass
in classClassLoader
- Parameters:
name
- A class name to loadresolve
- If true the loaded class is resolved- Returns:
- class definition of the requested class
- Throws:
ClassNotFoundException
- If the class was not found
-
getLibrary
get the library this loader is responsible for- Returns:
- library linked to this classloader
-
getResource
get the URL for a resource- Overrides:
getResource
in classClassLoader
- Parameters:
resourceName
- A resource name- Returns:
- Returns the URL for the resource or
null
, if the resource was not found
-