Class StaticDiscoveryProvider

java.lang.Object
org.wildfly.discovery.impl.StaticDiscoveryProvider
All Implemented Interfaces:
DiscoveryProvider

public final class StaticDiscoveryProvider extends Object implements DiscoveryProvider
A discovery provider using a static configuration.
Author:
David M. Lloyd
  • Constructor Details

    • StaticDiscoveryProvider

      public StaticDiscoveryProvider(List<ServiceURL> services)
      Construct a new instance.
      Parameters:
      services - the list of services to advertise
  • Method Details

    • discover

      public DiscoveryRequest discover(ServiceType serviceType, FilterSpec filterSpec, DiscoveryResult result)
      Description copied from interface: DiscoveryProvider
      Attempt to discover implementations of a service. Matches must be written to the DiscoveryResult.addMatch(ServiceURL) method on the result parameter as they are found. The DiscoveryResult.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:
      discover in interface DiscoveryProvider
      Parameters:
      serviceType - the service type to match
      filterSpec - the service attribute filter expression, or null to return all matches
      result - the discovery result