Skip to content

Commit 9efc13d

Browse files
committed
test with robaho for now
1 parent 94d9fa3 commit 9efc13d

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

avaje-jex-websockets/pom.xml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.avaje</groupId>
55
<artifactId>avaje-jex-parent</artifactId>
6-
<version>3.3-RC5</version>
6+
<version>3.3</version>
77
</parent>
88
<artifactId>avaje-jex-websocket</artifactId>
99
<dependencies>
@@ -16,20 +16,10 @@
1616
<artifactId>avaje-jex-test</artifactId>
1717
<scope>test</scope>
1818
</dependency>
19-
</dependencies>
20-
<profiles>
21-
<profile>
22-
<id>lessThan26</id>
23-
<activation>
24-
<jdk>[21, 25]</jdk>
25-
</activation>
26-
<dependencies>
2719
<dependency>
2820
<groupId>io.github.robaho</groupId>
2921
<artifactId>httpserver</artifactId>
3022
<scope>test</scope>
3123
</dependency>
32-
</dependencies>
33-
</profile>
34-
</profiles>
24+
</dependencies>
3525
</project>

avaje-jex-websockets/src/main/java/io/avaje/jex/websocket/WebSocketPlugin.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ public WebSocketPlugin ws(String path, WebSocketListener listener, Role... roles
2828
@Override
2929
public void apply(Jex jex) {
3030
jex.routing().addAll(handlers);
31-
if (Runtime.version().feature() < 26
32-
&& jex.config().serverProvider().getClass().getPackageName().indexOf("sun.") != -1) {
33-
throw new IllegalStateException(
34-
"WebSocket support requires Java 26+ when using the default JDK server provider. Upgrade your JDK or use a different server provider such as robaho httpserver");
31+
32+
var provider = jex.config().serverProvider().getClass().getPackageName();
33+
34+
if (Runtime.version().feature() < 27 && provider.indexOf("sun.") != -1
35+
|| provider.indexOf("jetty.") != -1) {
36+
throw new UnsupportedOperationException(
37+
"WebSocket not supported for this version of %s, use a newer/different server provider"
38+
.formatted(jex.config().serverProvider().getClass()));
3539
}
3640
}
3741

0 commit comments

Comments
 (0)