io.sarl.lang.core
Class SREClassLoader
final class SREClassLoader
extends java.lang.Object
Utility functions for helping to obtain a class loader that could be used by the SRE.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Since:
0.12
Action Summary
Modifier and type Action and description
static java.lang.ClassLoader getPreferredSREClassloader
Replies the class loader that should be preferred for loading classes in the SRE.
static T getPreferredSREClassloader(Class<T>)
Replies the class loader that should be preferred for loading classes in the SRE.
static java.lang.Class<T> loadClass(String,ClassLoader)
Load a class with the preferred class loaders.
static java.lang.Class<T> loadClass(String,boolean,ClassLoader)
Load a class with the preferred class loaders.
static void setPreferredSREClassloader(ClassLoader)
Change the class loader that should be preferred for loading classes in the SRE.
Action Details
getPreferredSREClassloader
def getPreferredSREClassloader : java.lang.ClassLoader
Replies the class loader that should be preferred for loading classes in the SRE.
Returns:
the preferred class loader; never null .
Since:
0.13
getPreferredSREClassloader(Class<T>)
def getPreferredSREClassloader(Class<T>) : T

with T extends java.lang.ClassLoader

Replies the class loader that should be preferred for loading classes in the SRE.
Parameters:
<T> - the expected type of the class loader.
type - the expected type of the class loader.
Returns:
the preferred class loader; or null if the class loader is not of the specified type.
Since:
0.13
loadClass(String,ClassLoader)
def loadClass(String,ClassLoader) : java.lang.Class<T>

throws java.lang.ClassNotFoundException

Load a class with the preferred class loaders.
Parameters:
classname - the name of the class to load.
context - the class loader to use first. If could be null. In this case the system class loaders are used.
Returns:
the class.
Throws exception:
  • java.lang.ClassNotFoundException: if the class cannot be found.
loadClass(String,boolean,ClassLoader)
def loadClass(String,boolean,ClassLoader) : java.lang.Class<T>

throws java.lang.ClassNotFoundException

Load a class with the preferred class loaders.
Parameters:
classname - the name of the class to load.
initialize - indicates if the class must be initialize.
context - the class loader to use first. If could be null. In this case the system class loaders are used.
Returns:
the class.
Throws exception:
  • java.lang.ClassNotFoundException: if the class cannot be found.
setPreferredSREClassloader(ClassLoader)
def setPreferredSREClassloader(ClassLoader)
Change the class loader that should be preferred for loading classes in the SRE.
Parameters:
classLoader - the preferred class loader; never null.
Since:
0.13