Class ServiceProviderRegistryImpl

  • All Implemented Interfaces:
    com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry

    public final class ServiceProviderRegistryImpl
    extends java.lang.Object
    implements com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
    A service provider registry contains all available service providers. During startup of JEAF the registry will try to load all configured service providers.
    Version:
    1.0
    Author:
    JEAF Development Team
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<com.anaptecs.jeaf.core.api.ServiceProvider> getAllServiceProviders()
      Method returns all available service providers.
      java.util.Collection<java.lang.Class<? extends com.anaptecs.jeaf.core.api.ServiceProvider>> getAvailableServiceProviderClasses()
      Method returns the class objects of all service providers that are available within this registry.
      <T extends com.anaptecs.jeaf.core.api.ServiceProvider>
      T
      getServiceProvider​(java.lang.Class<T> pServiceProviderInterface)
      Method performs a lookup for the service provider of the passed type.
      <T extends com.anaptecs.jeaf.core.api.ServiceProvider>
      com.anaptecs.jeaf.core.spi.ServiceProviderImplementation
      getServiceProviderImpl​(java.lang.Class<T> pServiceProviderInterface)
      Method performs a lookup for the service provider implementation of the passed type.
      void registerServiceProvider​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.ServiceProvider> pServiceProviderInterface, com.anaptecs.jeaf.core.spi.ServiceProviderImplementation pServiceProviderImpl)
      Method registers the passed service provider as implementation for the passed service provider interface.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceProviderRegistryImpl

        public ServiceProviderRegistryImpl()
        Initialize object.
    • Method Detail

      • registerServiceProvider

        public void registerServiceProvider​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.ServiceProvider> pServiceProviderInterface,
                                            com.anaptecs.jeaf.core.spi.ServiceProviderImplementation pServiceProviderImpl)
        Method registers the passed service provider as implementation for the passed service provider interface. Existing service provider must not be overwritten with a new implementation.
        Specified by:
        registerServiceProvider in interface com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
        Parameters:
        pServiceProviderInterface - Interface under which the passed service provider implementation should be registered. The parameter must not be null.
        pServiceProviderImpl - Service provider implementation that should be registered. The parameter must not be null.
      • getAvailableServiceProviderClasses

        public java.util.Collection<java.lang.Class<? extends com.anaptecs.jeaf.core.api.ServiceProvider>> getAvailableServiceProviderClasses()
        Method returns the class objects of all service providers that are available within this registry.
        Specified by:
        getAvailableServiceProviderClasses in interface com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
        Returns:
        Collection Class object of a service provider interfaces. The method never returns null and the collection is unmodifiable.
      • getServiceProvider

        public <T extends com.anaptecs.jeaf.core.api.ServiceProvider> T getServiceProvider​(java.lang.Class<T> pServiceProviderInterface)
                                                                                    throws com.anaptecs.jeaf.xfun.api.errorhandling.JEAFSystemException
        Method performs a lookup for the service provider of the passed type.
        Specified by:
        getServiceProvider in interface com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
        Type Parameters:
        T - Type
        Parameters:
        pServiceProviderInterface - Class object of the service provider interface for which a service provider implementation object should be returned. The parameter must not be null.
        Returns:
        ServiceProvider Service provider implementation of the passed interface. The method never returns null.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.JEAFSystemException - if no service provider of the passed type is available.
      • getServiceProviderImpl

        public <T extends com.anaptecs.jeaf.core.api.ServiceProvider> com.anaptecs.jeaf.core.spi.ServiceProviderImplementation getServiceProviderImpl​(java.lang.Class<T> pServiceProviderInterface)
        Method performs a lookup for the service provider implementation of the passed type.
        Specified by:
        getServiceProviderImpl in interface com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
        Type Parameters:
        T - Type
        Parameters:
        pServiceProviderInterface - Class object of the service provider interface for which a service provider implementation object should be returned. The parameter must not be null.
        Returns:
        ServiceProviderImplementation Service provider implementation of the passed interface. The method never returns null.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.JEAFSystemException - if no service provider of the passed type is available.
      • getAllServiceProviders

        public java.util.Collection<com.anaptecs.jeaf.core.api.ServiceProvider> getAllServiceProviders()
        Method returns all available service providers.
        Specified by:
        getAllServiceProviders in interface com.anaptecs.jeaf.core.servicechannel.api.ServiceProviderRegistry
        Returns:
        Collection All available service providers. The method never returns null.