Skip to content

Commit 8508b8d

Browse files
authored
fix: Split out server related code from a2a-java-sdk-core into a new a2a-java-sdk-server-common module (#129)
This PR splits out server related code from the `a2a-java-sdk-core` module into a new `a2a-java-sdk-server-common` module that is used by the quarkus and jakarta server modules. This reduces the dependencies required by the `a2a-java-sdk-core` module.
1 parent 6042cca commit 8508b8d

File tree

61 files changed

+156
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+156
-85
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ The A2A Java SDK provides a Java server implementation of the [Agent2Agent (A2A)
5050
### 2. Add a class that creates an A2A Agent Card
5151

5252
```java
53+
import io.a2a.server.PublicAgentCard;
5354
import io.a2a.spec.AgentCapabilities;
5455
import io.a2a.spec.AgentCard;
5556
import io.a2a.spec.AgentSkill;
56-
import io.a2a.spec.PublicAgentCard;
5757
...
5858

5959
@ApplicationScoped

core/pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@
2525
<groupId>com.fasterxml.jackson.datatype</groupId>
2626
<artifactId>jackson-datatype-jsr310</artifactId>
2727
</dependency>
28-
<dependency>
29-
<groupId>io.smallrye.reactive</groupId>
30-
<artifactId>mutiny-zero</artifactId>
31-
</dependency>
32-
<dependency>
33-
<groupId>jakarta.enterprise</groupId>
34-
<artifactId>jakarta.enterprise.cdi-api</artifactId>
35-
<scope>provided</scope>
36-
</dependency>
37-
<dependency>
38-
<groupId>org.slf4j</groupId>
39-
<artifactId>slf4j-api</artifactId>
40-
</dependency>
41-
<dependency>
42-
<groupId>io.quarkus</groupId>
43-
<artifactId>quarkus-arc</artifactId>
44-
<scope>test</scope>
45-
</dependency>
4628
<dependency>
4729
<groupId>org.junit.jupiter</groupId>
4830
<artifactId>junit-jupiter-api</artifactId>

core/src/main/java/io/a2a/client/A2ACardResolver.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
import java.io.IOException;
66
import java.util.Map;
7-
import java.util.concurrent.CompletableFuture;
8-
import java.util.concurrent.CountDownLatch;
9-
import java.util.concurrent.atomic.AtomicReference;
107

118
import com.fasterxml.jackson.core.JsonProcessingException;
129
import com.fasterxml.jackson.core.type.TypeReference;
1310
import io.a2a.http.A2AHttpClient;
1411
import io.a2a.http.A2AHttpResponse;
15-
import io.a2a.spec.A2A;
1612
import io.a2a.spec.A2AClientError;
1713
import io.a2a.spec.A2AClientJSONError;
1814
import io.a2a.spec.AgentCard;

core/src/main/java/io/a2a/client/sse/SSEEventListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
import java.util.concurrent.Future;
66
import java.util.function.Consumer;
7+
import java.util.logging.Logger;
78

89
import com.fasterxml.jackson.core.JsonProcessingException;
910
import com.fasterxml.jackson.databind.JsonNode;
1011
import io.a2a.spec.JSONRPCError;
1112
import io.a2a.spec.StreamingEventKind;
1213
import io.a2a.spec.TaskStatusUpdateEvent;
13-
import org.slf4j.Logger;
14-
import org.slf4j.LoggerFactory;
1514

1615
public class SSEEventListener {
17-
private static final Logger log = LoggerFactory.getLogger(SSEEventListener.class);
16+
private static final Logger log = Logger.getLogger(SSEEventListener.class.getName());
1817
private final Consumer<StreamingEventKind> eventHandler;
1918
private final Consumer<JSONRPCError> errorHandler;
2019
private final Runnable failureHandler;
@@ -29,7 +28,7 @@ public void onMessage(String message, Future<Void> completableFuture) {
2928
try {
3029
handleMessage(OBJECT_MAPPER.readTree(message),completableFuture);
3130
} catch (JsonProcessingException e) {
32-
log.warn("Failed to parse JSON message: {}", message, e);
31+
log.warning("Failed to parse JSON message: " + message);
3332
}
3433
}
3534

core/src/main/java/io/a2a/http/JdkA2AHttpClient.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
import java.util.concurrent.Flow;
1515
import java.util.function.Consumer;
1616

17-
import jakarta.enterprise.context.ApplicationScoped;
18-
19-
@ApplicationScoped
2017
public class JdkA2AHttpClient implements A2AHttpClient {
2118

2219
private final HttpClient httpClient;

core/src/main/java/io/a2a/server/events/Event.java

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
package io.a2a.spec;
22

3-
import io.a2a.server.events.Event;
4-
53
public interface A2AError extends Event {
64
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package io.a2a.spec;
2+
3+
public interface Event {
4+
}

core/src/main/java/io/a2a/spec/JSONRPCError.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
88
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
99

10-
import io.a2a.server.events.Event;
1110
import io.a2a.util.Assert;
1211

1312
/**

core/src/main/java/io/a2a/spec/StreamingEventKind.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import com.fasterxml.jackson.annotation.JsonSubTypes;
99
import com.fasterxml.jackson.annotation.JsonTypeInfo;
10-
import io.a2a.server.events.Event;
1110

1211
@JsonTypeInfo(
1312
use = JsonTypeInfo.Id.NAME,

0 commit comments

Comments
 (0)