Class ApacheHc5TransportProvider

java.lang.Object
org.apache.juneau.rest.client.apachehttpclient50.ApacheHc5TransportProvider
All Implemented Interfaces:
HttpTransportProvider

public final class ApacheHc5TransportProvider extends Object implements HttpTransportProvider
HttpTransportProvider implementation that supplies an ApacheHc5Transport.

Registered via META-INF/services/org.apache.juneau.rest.client.HttpTransportProvider so that RestClient can auto-discover Apache HttpClient 5.x when this module is on the classpath.

See Also:
Since:
9.2.1
  • Constructor Details

  • Method Details

    • getPriority

      public int getPriority()
      Description copied from interface: HttpTransportProvider
      Returns the priority of this provider.

      When multiple providers are available, the one with the lowest priority value is used first. This allows applications to install a high-priority mock or test transport that takes precedence over real transports.

      Specified by:
      getPriority in interface HttpTransportProvider
      Returns:
      The priority. Defaults to 100.
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: HttpTransportProvider
      Returns true if the required runtime dependencies of this transport are present on the classpath.

      Providers must check for their dependencies here (e.g. by attempting to load the underlying client class) so that RestClient can safely skip providers whose jars are absent.

      Specified by:
      isAvailable in interface HttpTransportProvider
      Returns:
      true if available.
    • create

      Description copied from interface: HttpTransportProvider
      Creates and returns a new HttpTransport instance using default configuration.
      Specified by:
      create in interface HttpTransportProvider
      Returns:
      A new transport. Never null.