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().

Attention: This part of the API is preliminary and may change in future versions.

Since:
4.2.404

Field Summary
static SpecialistType<ModuleAgent> TYPE
          Type token, use this for SpecialistsBroker.requestSpecialist(de.espirit.firstspirit.agency.SpecialistType) or SpecialistsBroker.requireSpecialist(de.espirit.firstspirit.agency.SpecialistType).
 
Method Summary
 ClassLoader getClassLoader()
          Returns a class loader instance which is capable of loading all global module classes.
 Collection<ComponentDescriptor> getComponents(Class<?> type)
          Returns all components which implements or extends the given type.
<T> Class<? extends T>
getTypeForName(String name, Class<T> type)
          Returns the exported class that matches the given interface type and name.
 

Field Detail

TYPE

static final SpecialistType<ModuleAgent> TYPE
Type token, use this for SpecialistsBroker.requestSpecialist(de.espirit.firstspirit.agency.SpecialistType) or SpecialistsBroker.requireSpecialist(de.espirit.firstspirit.agency.SpecialistType).

Since:
4.2.404
Method Detail

getClassLoader

@NotNull
ClassLoader 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

@NotNull
Collection<ComponentDescriptor> getComponents(Class<?> type)
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

@Nullable
<T> Class<? extends T> getTypeForName(String name,
                                               Class<T> type)
Returns the exported class that matches the given interface type and name. Returns null if no match is found.

Parameters:
name - name to match
type - 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


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480