Class VertxA2AHttpClientProvider

java.lang.Object
org.a2aproject.sdk.client.http.vertx.VertxA2AHttpClientProvider
All Implemented Interfaces:
A2AHttpClientProvider

public final class VertxA2AHttpClientProvider extends Object implements A2AHttpClientProvider
Service provider for VertxA2AHttpClient.

This provider has priority 100, placing it above the JDK implementation (0) but below the Android (110) and CDI (200) providers. It is preferred over JDK when the Vert.x dependencies are available on the classpath.

If Vert.x classes are not available at runtime, this provider will check for their presence and throw an IllegalStateException when attempting to create a client. The ServiceLoader mechanism will skip this provider and fall back to the JDK implementation.

  • Constructor Details

    • VertxA2AHttpClientProvider

      public VertxA2AHttpClientProvider()
  • Method Details

    • create

      public A2AHttpClient create()
      Description copied from interface: A2AHttpClientProvider
      Creates a new instance of an A2AHttpClient.
      Specified by:
      create in interface A2AHttpClientProvider
      Returns:
      a new A2AHttpClient instance
    • priority

      public int priority()
      Description copied from interface: A2AHttpClientProvider
      Returns the priority of this provider. Higher priority providers are tried first; the first one whose A2AHttpClientProvider.create() succeeds is used.

      Built-in priorities (for reference when choosing a custom value):

      • CdiA2AHttpClient: 200 (CDI-provided bean, when a container and bean are active)
      • AndroidA2AHttpClient: 110 (Android runtime only)
      • VertxA2AHttpClient: 100 (when vertx-web-client is on the classpath)
      • JdkA2AHttpClient: 0 (always available, last resort)
      Specified by:
      priority in interface A2AHttpClientProvider
      Returns:
      the priority value (higher is better)
    • name

      public String name()
      Description copied from interface: A2AHttpClientProvider
      Returns the name of this provider for logging and debugging purposes.
      Specified by:
      name in interface A2AHttpClientProvider
      Returns:
      the provider name