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

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract S createProviderService​(P provider)
      Creates a new provider service bound to the specified provider.
      protected P defaultProvider()
      Returns the default fall-back provider.
      protected P getProvider​(java.lang.String scheme)
      Returns the provider registered with the specified scheme.
      protected P getProvider​(DeviceId deviceId)
      Returns the provider for the specified device ID based on URI scheme.
      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.
      java.util.Set<ProviderId> getProviders()
      Returns a set of currently registered provider identities.
      S register​(P provider)
      Registers the supplied provider with the core.
      void unregister​(P provider)
      Unregisters the supplied provider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.lang.String scheme)
        Returns the provider registered with the specified scheme.
        Parameters:
        scheme - provider scheme
        Returns:
        provider