Interface IRegistry

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    QFSRegistry

    public interface IRegistry
    extends Serializable
    Base interface of a ActiveViam Registry Provides method to instantiate Types and retrieve plugins.
    Author:
    ActiveViam
    • Method Detail

      • getName

        String getName()
        Gets the name of this instance of Registry.
        Returns:
        name of the registry
      • setName

        void setName​(String name)
        Sets the name of the registry.
        Parameters:
        name - The new name of the registry.
      • create

        <T,​U extends T> U create​(Class<T> interfaceClass,
                                       Object... initParams)
        Creates a new instance of a type identified by its interface, with the supplied parameters.
        Type Parameters:
        T - Type of the interface class
        U - 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

        <T extends IPluginValue,​U extends T> IPlugin<U> getPlugin​(Class<T> interfaceClass)
        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 as ExtendedPlugin<Collection<?>> e = getExtendedPlugin(Collection.class).
        Parameters:
        interfaceClass - The interface for which to retrieve the extended plugin.
        Returns:
        extended plugin instance
      • getTypeFactory

        <T,​U extends T> IFactory<U> getTypeFactory​(Class<T> intf)
        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

        Class<?> getTypeInterface​(Class<?> impl)
        Gets the type interface the implementation class may be associated with.
        Parameters:
        impl - implementation class
        Returns:
        the type