Class DiscoveryAgentFactory

    • Constructor Detail

      • DiscoveryAgentFactory

        public DiscoveryAgentFactory()
    • Method Detail

      • createDiscoveryAgent

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

        public abstract String getName()
        Returns:
        the name of this discovery agent, e.g. Multicast, Zeroconf, etc.
      • createAgent

        public static DiscoveryAgent createAgent​(URI remoteURI)
                                          throws Exception
        Static create method that performs the DiscoveryAgent search and handles the configuration and setup.
        Parameters:
        remoteURI - the URI used to configure the discovery mechanism.
        Returns:
        a new DiscoveryAgent instance that is ready for use.
        Throws:
        Exception - if an error occurs while creating the DiscoveryAgent instance.
      • findAgentFactory

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