@Slf4j @CompileStatic class GrailsFactoriesLoader extends FactoriesLoaderSupport
General purpose factory loading mechanism for internal use within the framework.
Based on SpringFactoriesLoader, but applies caching and uses a different file name
| Properties inherited from class | Properties |
|---|---|
class FactoriesLoaderSupport |
CLI_FACTORIES_RESOURCE_LOCATION, FACTORIES_RESOURCE_LOCATION |
| Constructor and description |
|---|
GrailsFactoriesLoader() |
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
static java.util.List<T> |
loadFactories(java.lang.Class<T> factoryClass)Load the factory implementations of the given type from the default location, using the given class loader. |
<T> |
static java.util.List<T> |
loadFactories(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader)Load the factory implementations of the given type from the default location, using the given class loader. |
<T> |
static java.util.List<T> |
loadFactories(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.String resourceLocation)Load the factory implementations of the given type from the given resource location, using the given class loader. |
<T> |
static java.util.List<T> |
loadFactoriesWithArguments(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object[] arguments) |
<T> |
static T |
loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader) |
<T> |
static T |
loadFactory(java.lang.Class<T> factoryClass, java.lang.Object[] arguments) |
<T> |
static T |
loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object[] arguments) |
<T> |
static java.util.List<java.lang.Class<T>> |
loadFactoryClasses(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.String resourceLocation) |
|
static java.util.Map<java.lang.String, java.util.List<java.lang.String>> |
loadFactoryDeclarations(java.lang.Class<?> factoryClass, java.lang.ClassLoader classLoader, java.lang.String resourceLocation)Loads factory class names grouped by the resource that declares them without loading the classes themselves. |
|
static java.util.Map<java.lang.String, java.util.List<java.lang.String>> |
loadFactoryDeclarations(java.lang.String factoryClassName, java.lang.ClassLoader classLoader, java.lang.String resourceLocation) |
| Methods inherited from class | Name |
|---|---|
class FactoriesLoaderSupport |
loadFactoryNames, loadFactoryNames |
Load the factory implementations of the given type from the default location, using the given class loader.
The returned factories are ordered in accordance with the OrderComparator.
factoryClass - the interface or abstract class representing the factoryLoad the factory implementations of the given type from the default location, using the given class loader.
The returned factories are ordered in accordance with the OrderComparator.
factoryClass - the interface or abstract class representing the factoryclassLoader - the ClassLoader to use for loading (can be null to use the default)Load the factory implementations of the given type from the given resource location, using the given class loader.
The returned factories are ordered in accordance with the OrderComparator.
factoryClass - the interface or abstract class representing the factoryclassLoader - the ClassLoader to use for loading (can be null to use the default)resourceLocation - the classpath location of the factories files to read
(e.g. CLI_FACTORIES_RESOURCE_LOCATION)Loads factory class names grouped by the resource that declares them without loading the classes themselves. This lets callers that need diagnostic context apply stricter class loading semantics than the framework-wide best-effort factory loader.