Package org.wildfly.discovery.impl
Class MutableDiscoveryProvider
java.lang.Object
org.wildfly.discovery.impl.MutableDiscoveryProvider
- All Implemented Interfaces:
DiscoveryProvider
A discovery provider which can be mutated at run time to delegate to a new provider.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from interface org.wildfly.discovery.spi.DiscoveryProvider
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance using an empty provider.MutableDiscoveryProvider(DiscoveryProvider initialProvider) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptiondiscover(ServiceType serviceType, FilterSpec filterSpec, DiscoveryResult result) Attempt to discover implementations of a service.voidsetDiscoveryProvider(DiscoveryProvider delegateProvider) Set the discovery provider instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.discovery.spi.DiscoveryProvider
processMissingTarget
-
Constructor Details
-
MutableDiscoveryProvider
Construct a new instance.- Parameters:
initialProvider- the initial provider to use (must not benull)
-
MutableDiscoveryProvider
public MutableDiscoveryProvider()Construct a new instance using an empty provider.
-
-
Method Details
-
setDiscoveryProvider
Set the discovery provider instance.- Parameters:
delegateProvider- the discovery provider instance (must not benull)
-
discover
public DiscoveryRequest discover(ServiceType serviceType, FilterSpec filterSpec, DiscoveryResult result) Description copied from interface:DiscoveryProviderAttempt to discover implementations of a service. Matches must be written to theDiscoveryResult.addMatch(ServiceURL)method on theresultparameter as they are found. TheDiscoveryResult.complete()method must be called when the discovery process is complete or has timed out or failed for any other reason, otherwise discovery clients may hang indefinitely.The discovery process should be asynchronous if possible. In this case, this method should return as soon as possible in order to unblock the calling thread quickly and allow other discovery mechanisms to proceed. The discovery process will not be considered complete until the result's completion method is called, even if such a call comes from a different thread.
- Specified by:
discoverin interfaceDiscoveryProvider- Parameters:
serviceType- the service type to matchfilterSpec- the service attribute filter expression, ornullto return all matchesresult- the discovery result
-