Class A2AServerResource

java.lang.Object
org.wildfly.extras.a2a.server.apps.jakarta.A2AServerResource

@Path("/") public class A2AServerResource extends Object
  • Constructor Details

    • A2AServerResource

      public A2AServerResource()
  • Method Details

    • handleNonStreamingRequests

      @POST @Consumes("application/json") @Produces("application/json") public io.a2a.spec.JSONRPCResponse<?> handleNonStreamingRequests(io.a2a.spec.NonStreamingJSONRPCRequest<?> request, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
      Handles incoming POST requests to the main A2A endpoint. Dispatches the request to the appropriate JSON-RPC handler method and returns the response.
      Parameters:
      request - the JSON-RPC request
      Returns:
      the JSON-RPC response which may be an error response
    • handleStreamingRequests

      @POST @Consumes("application/json") @Produces("text/event-stream") public void handleStreamingRequests(io.a2a.spec.StreamingJSONRPCRequest<?> request, @Context jakarta.servlet.http.HttpServletResponse response, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext, @Context jakarta.ws.rs.ext.Providers providers) throws IOException
      Handles incoming POST requests to the main A2A endpoint that involve Server-Sent Events (SSE). Uses custom SSE response handling to avoid JAX-RS SSE compatibility issues with async publishers.
      Throws:
      IOException
    • getAgentCard

      @GET @Path("/.well-known/agent-card.json") @Produces("application/json") public io.a2a.spec.AgentCard getAgentCard()
      Handles incoming GET requests to the agent card endpoint. Returns the agent card in JSON format.
      Returns:
      the agent card
    • setStreamingIsSubscribedRunnable

      public static void setStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable)