Class ServiceFinder.Builder<T>

java.lang.Object
org.glassfish.jersey.internal.ServiceFinder.Builder<T>
Enclosing class:
ServiceFinder<T>

public static final class ServiceFinder.Builder<T> extends Object
Author:
Mark Reinhold, Jakub Podlesak, Marek Potociar
  • Method Details

    • find

      public ServiceFinder<T> find()
      Create the service finder capable of locating the services with information specified by the builder.
      Returns:
      the service finder instance.
    • serviceName

      public ServiceFinder.Builder<T> serviceName(String serviceName)
      Set the service name the service finder use to locate the services.
      Parameters:
      serviceName - the service name correspond to a file in META-INF/services that contains a list of fully qualified class names.
      Returns:
      the updated builder.
    • loader

      public ServiceFinder.Builder<T> loader(ClassLoader loader)
      Set the service finder to use the given Classloader. By default, the context classloader is used.
      Parameters:
      loader - the given classloader for the service finder to use when searching for the service.
      Returns:
      the updated builder.
    • ignoreNotFound

      public ServiceFinder.Builder<T> ignoreNotFound(boolean ignoreOnClassNotFound)
      Set the service finder to ignore the service if not found. The default is false.
      Parameters:
      ignoreOnClassNotFound - whether to ignore the service not found or not.
      Returns:
      the updated builder.
    • runtimeType

      public ServiceFinder.Builder<T> runtimeType(RuntimeType runtimeType)
      Update the builder with a specified runtime type the searched services are constrained to it.
      Parameters:
      runtimeType - the specified runtime type.
      Returns:
      the updated builder.