Class ProviderFactory

    • Constructor Detail

      • ProviderFactory

        public ProviderFactory()
    • Method Detail

      • createProvider

        public abstract Provider createProvider​(URI remoteURI)
                                         throws Exception
        Creates an instance of the given AsyncProvider and configures it using the properties set on the given remote broker URI.
        Parameters:
        remoteURI - The URI used to connect to a remote Broker.
        Returns:
        a new AsyncProvider instance.
        Throws:
        Exception - if an error occurs while creating the Provider instance.
      • createProvider

        public abstract Provider createProvider​(URI remoteURI,
                                                ProviderFutureFactory futureFactory)
                                         throws Exception
        Creates an instance of the given AsyncProvider and configures it using the properties set on the given remote broker URI.
        Parameters:
        remoteURI - The URI used to connect to a remote Broker.
        futureFactory - The ProviderFutureFactory to use when creating the new Provider.
        Returns:
        a new AsyncProvider instance.
        Throws:
        Exception - if an error occurs while creating the Provider instance.
      • getName

        public abstract String getName()
        Returns:
        the name of this Provider.
      • create

        public static Provider create​(URI remoteURI)
                               throws Exception
        Static create method that performs the ProviderFactory search and handles the configuration and setup.
        Parameters:
        remoteURI - the URI of the remote peer.
        Returns:
        a new AsyncProvider instance that is ready for use.
        Throws:
        Exception - if an error occurs while creating the AsyncProvider instance.
      • create

        public static Provider create​(URI remoteURI,
                                      ProviderFutureFactory futureFactory)
                               throws Exception
        Static create method that performs the ProviderFactory search and handles the configuration and setup.
        Parameters:
        remoteURI - the URI of the remote peer.
        futureFactory - the ProviderFutureFactory to use when building the new Provider.
        Returns:
        a new AsyncProvider instance that is ready for use.
        Throws:
        Exception - if an error occurs while creating the AsyncProvider instance.
      • findProviderFactory

        public static ProviderFactory findProviderFactory​(URI location)
                                                   throws IOException
        Searches for a ProviderFactory by using the scheme from the given URI. The search first checks the local cache of provider factories before moving on to search in the class path.
        Parameters:
        location - The URI whose scheme will be used to locate a ProviderFactory.
        Returns:
        a provider factory instance matching the URI's scheme.
        Throws:
        IOException - if an error occurs while locating the factory.
      • findProviderFactory

        public static ProviderFactory findProviderFactory​(String scheme)
                                                   throws IOException
        Searches for a ProviderFactory by using the scheme given. The search first checks the local cache of provider factories before moving on to search in the class path.
        Parameters:
        scheme - The URI scheme that describes the desired factory.
        Returns:
        a provider factory instance matching the scheme.
        Throws:
        IOException - if an error occurs while locating the factory.