Package com.quartetfs.fwk
Interface IRegistry
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
QFSRegistry
Base interface of a ActiveViam Registry Provides method to instantiate Types and retrieve
plugins.
- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescription<T,U extends T>
UCreates a new instance of a type identified by its interface, with the supplied parameters.<T extends IExtendedPluginValue,U extends T>
IExtendedPlugin<U>getExtendedPlugin(Class<T> interfaceClass) Returns the extended plugin instance registered with the extended plugin value interface.getName()Gets the name of this instance of Registry.<T extends IPluginValue,U extends T>
IPlugin<U>Returns the plugin instance registered with the plugin value interface.<T,U extends T>
IFactory<U>getTypeFactory(Class<T> intf) Return the factory used by this registry to instantiate types of the given interface.Class<?>getTypeInterface(Class<?> impl) Gets the type interface the implementation class may be associated with.voidSets the name of the registry.default <T,U extends T>
voidDefines an Atoti type.
-
Method Details
-
getName
String getName()Gets the name of this instance of Registry.- Returns:
- name of the registry
-
setName
Sets the name of the registry.- Parameters:
name- The new name of the registry.
-
create
Creates a new instance of a type identified by its interface, with the supplied parameters.- Type Parameters:
T- Type of the interface classU- the type of the interface, including generic parameters if any- Parameters:
interfaceClass- The interface of which to create an instance of.initParams- The parameters to create the instance with.- Returns:
- new instance of the Type
-
getPlugin
Returns the plugin instance registered with the plugin value interface.- Type Parameters:
T- the type of the interface.U- the type of the interface, including generic parameters if any- Parameters:
interfaceClass- The interface for which to retrieve the plugin.- Returns:
- plugin instance
-
getExtendedPlugin
<T extends IExtendedPluginValue,U extends T> IExtendedPlugin<U> getExtendedPlugin(Class<T> interfaceClass) Returns the extended plugin instance registered with the extended plugin value interface.- Type Parameters:
T- the type of the interface.U- expected type of the plugin. This is set mainly to correctly support extended plugin for generic interfaces, such asExtendedPlugin<Collection<?>> e = getExtendedPlugin(Collection.class).- Parameters:
interfaceClass- The interface for which to retrieve the extended plugin.- Returns:
- extended plugin instance
-
getTypeFactory
Return the factory used by this registry to instantiate types of the given interface. Returns null if the interface does not define a valid type.- Type Parameters:
T- the type of the interface.U- Type of the interface including generic parameters if any- Parameters:
intf- The interface for which to retrieve the type factory.- Returns:
- type factory
-
getTypeInterface
Gets the type interface the implementation class may be associated with.- Parameters:
impl- implementation class- Returns:
- the type
-
setType
Defines an Atoti type.For a given interface, this sets a corresponding implementation. After this call, it will be possible to call
create(Class, Object...), passing the interface and constructor arguments to create instances for the bound type.If an implementation class is already assigned to the interface, this call replaces the previous value with the provided implementation class.
- Type Parameters:
T- Type of the interface classU- Type of the implementation class
-