Class AbstractProviderRegistry<P extends Provider,​S extends ProviderService<P>>

    • Constructor Detail

      • AbstractProviderRegistry

        public AbstractProviderRegistry()
    • Method Detail

      • createProviderService

        protected abstract S createProviderService​(P provider)
        Creates a new provider service bound to the specified provider.
        Parameters:
        provider - provider
        Returns:
        provider service
      • defaultProvider

        protected P defaultProvider()
        Returns the default fall-back provider. Default implementation return null.
        Returns:
        default provider
      • register

        public S register​(P provider)
        Description copied from interface: ProviderRegistry
        Registers the supplied provider with the core.
        Specified by:
        register in interface ProviderRegistry<P extends Provider,​S extends ProviderService<P>>
        Parameters:
        provider - provider to be registered
        Returns:
        provider service for injecting information into core
      • unregister

        public void unregister​(P provider)
        Description copied from interface: ProviderRegistry
        Unregisters the supplied provider. As a result the previously issued provider service will be invalidated and any subsequent invocations of its methods may throw IllegalStateException.

        Unregistering a provider that has not been previously registered results in a no-op.

        Specified by:
        unregister in interface ProviderRegistry<P extends Provider,​S extends ProviderService<P>>
        Parameters:
        provider - provider to be unregistered
      • getProvider

        protected P getProvider​(ProviderId providerId)
        Returns the provider registered with the specified provider ID or null if none is found for the given provider family and default fall-back is not supported.
        Parameters:
        providerId - provider identifier
        Returns:
        provider
      • getProvider

        protected P getProvider​(DeviceId deviceId)
        Returns the provider for the specified device ID based on URI scheme.
        Parameters:
        deviceId - device identifier
        Returns:
        provider bound to the URI scheme
      • getProvider

        protected P getProvider​(String scheme)
        Returns the provider registered with the specified scheme.
        Parameters:
        scheme - provider scheme
        Returns:
        provider