Class DefaultServicesRegistry

    • Constructor Detail

      • DefaultServicesRegistry

        public DefaultServicesRegistry()
    • Method Detail

      • registerService

        public <T,​E extends T> IServicesRegistry registerService​(java.lang.Class<T> clazz,
                                                                       java.lang.String name,
                                                                       E service)
        Default implementation of IServiceRegistry class
        Specified by:
        registerService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        E - the implementation of the service type T
        Parameters:
        clazz - the interface class, which should the provider of the service
        name - the name of the service, which should registered
        service - the service instance to register
        Returns:
        the current instance, of the class, which was used to offerTask this method
        See Also:
        IServicesRegistry
      • unregisterService

        public <T,​E extends T> IServicesRegistry unregisterService​(java.lang.Class<T> clazz,
                                                                         java.lang.Class<E> serviceClazz)
        Default implementation of IServiceRegistry class
        Specified by:
        unregisterService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        E - the implementation of the service type T
        Parameters:
        clazz - the interface class, which should the provider of the service
        serviceClazz - the class, of the services which should unregister
        Returns:
        the current instance of the ServiceRegistry
        See Also:
        IServicesRegistry
      • unregisterService

        public <T,​E extends T> IServicesRegistry unregisterService​(java.lang.Class<T> clazz,
                                                                         E service)
        Default implementation of IServiceRegistry class
        Specified by:
        unregisterService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        E - the implementation of the service type T
        Parameters:
        clazz - the interface class, which should the provider of the service
        service - the instance
        Returns:
        the current instance of the ServiceRegistry
        See Also:
        IServicesRegistry
      • containsService

        public <T> boolean containsService​(java.lang.Class<T> clazz,
                                           java.lang.String name)
        Default implementation of IServiceRegistry class
        Specified by:
        containsService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        Parameters:
        clazz - the provider class
        name - the name of the service, from that should be check
        Returns:
        true if a service from the provider is contain in this registry
        See Also:
        IServicesRegistry
      • unregisterService

        public <T> IServicesRegistry unregisterService​(java.lang.Class<T> clazz,
                                                       java.lang.String name)
        Default implementation of IServiceRegistry class
        Specified by:
        unregisterService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        Parameters:
        clazz - the base class from that the service should be removed
        name - the registered name from the service implementation
        Returns:
        the current instance of the ServiceRegistry
        See Also:
        IServicesRegistry
      • unregisterServices

        public <T> IServicesRegistry unregisterServices​(java.lang.Class<T> clazz)
        Default implementation of IServiceRegistry class
        Specified by:
        unregisterServices in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        Parameters:
        clazz - the provider base class from that should all services be removed
        Returns:
        the current instance of the ServiceRegistry
        See Also:
        IServicesRegistry
      • unregisterAll

        public IServicesRegistry unregisterAll​(java.lang.ClassLoader classLoader)
        Default implementation of IServiceRegistry class
        Specified by:
        unregisterAll in interface IServicesRegistry
        Parameters:
        classLoader - the classLoader, from that all services should be removed
        Returns:
        the current instance of the ServiceRegistry
        See Also:
        IServicesRegistry
      • getService

        public <T> T getService​(java.lang.Class<T> clazz,
                                java.lang.String name)
        Default implementation of IServiceRegistry class
        Specified by:
        getService in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        Parameters:
        clazz - the base provider class, from that the service should get
        name - the name of the service that should get
        Returns:
        the service implementation of the base class or the base class himself
        See Also:
        IServicesRegistry
      • getServices

        public <T> java.util.Collection<T> getServices​(java.lang.Class<T> clazz)
        Default implementation of IServiceRegistry class
        Specified by:
        getServices in interface IServicesRegistry
        Type Parameters:
        T - the interface or abstract type which you want the implementation providing for
        Parameters:
        clazz - the base provider class, from that the service should get
        Returns:
        the service implementations of the base class or the base class himself
        See Also:
        IServicesRegistry