Class DiscoveryAgentFactory
- java.lang.Object
-
- org.apache.qpid.jms.provider.discovery.DiscoveryAgentFactory
-
- Direct Known Subclasses:
FileWatcherDiscoveryAgentFactory,MulticastDiscoveryAgentFactory
public abstract class DiscoveryAgentFactory extends Object
Factory used to find and create instances of DiscoveryAgent using the name of the desired agent to locate it's factory class definition file.
-
-
Constructor Summary
Constructors Constructor Description DiscoveryAgentFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DiscoveryAgentcreateAgent(URI remoteURI)Static create method that performs the DiscoveryAgent search and handles the configuration and setup.abstract DiscoveryAgentcreateDiscoveryAgent(URI remoteURI)Creates an instance of the given DiscoveryAgent and configures it using the properties set on the given remote broker URI.protected static DiscoveryAgentFactoryfindAgentFactory(URI location)Searches for a DiscoveryAgentFactory by using the scheme from the given URI.abstract StringgetName()
-
-
-
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.
-
-