Package org.wildfly.discovery.spi
Interface DiscoveryProvider
- All Known Implementing Classes:
AggregateDiscoveryProvider,LocalRegistryAndDiscoveryProvider,MutableDiscoveryProvider,StaticDiscoveryProvider
public interface DiscoveryProvider
A discovery provider. This interface is implemented by all discovery provider implementations.
- Author:
- David M. Lloyd
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondiscover(ServiceType serviceType, FilterSpec filterSpec, DiscoveryResult result) Attempt to discover implementations of a service.default voidprocessMissingTarget(URI location, Exception cause) This method is invoked on provider if the invocation using discovered URI was not successful.
-
Field Details
-
EMPTY
The empty discovery provider.
-
-
Method Details
-
discover
Attempt 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.
- Parameters:
serviceType- the service type to matchfilterSpec- the service attribute filter expression, ornullto return all matchesresult- the discovery result
-
processMissingTarget
This method is invoked on provider if the invocation using discovered URI was not successful. This method is supposed to be used by lazy discovery algorithms. By default, it is set to empty method so it could be skipped by providers implementing polling algorithms.- Parameters:
location- location on which invocations has failedcause- the cause of the failure
-