Package de.espirit.firstspirit.access
Interface ModuleAgent
public interface ModuleAgent
Interface for a class that brokers a class loader instance which is capable of loading public classes.
Usage:
specialistsBroker.requireSpecialist
(ModuleAgent.TYPE
).getClassLoader()
.
- Since:
- 4.2.404
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<ModuleAgent>
Specialist providing means to load public classes. -
Method Summary
Modifier and TypeMethodDescription@NotNull ClassLoader
Returns a class loader instance which is capable of loading all global module classes.@NotNull Collection<ComponentDescriptor>
getComponents
(Class<?> type) Returns all components which implements or extends the given type.<T> @Nullable Class<? extends T>
getTypeForName
(String name, Class<T> type) Returns the exported class that matches the given interfacetype
andname
.
-
Field Details
-
TYPE
Specialist providing means to load public classes.- Since:
- 4.2.404
-
-
Method Details
-
getClassLoader
Returns a class loader instance which is capable of loading all global module classes.- Returns:
- A class loader instance which is capable of loading all global module classes.
- Since:
- 4.2.404
-
getComponents
Returns all components which implements or extends the given type.- Parameters:
type
- The requested type.- Returns:
- A collection of matching
descriptors
. - Since:
- 4.2.404
-
getTypeForName
Returns the exported class that matches the given interfacetype
andname
. Returnsnull
if no match is found.- Parameters:
name
- name to matchtype
- interface to match- Returns:
- The exported class matching the given parameters or
null
if there is no matching exported class - Throws:
IllegalStateException
- if loading of the exported class fails.- Since:
- 4.2.404
-