The Apache Tomcat web containers supports web sockets. The basic web sockets samples it includes can serve as a great jump start. The following video clip shows the execution of one of these samples.

Stable Values in Java (JEP 502): Deferred Immutability with JVM Trust
Explore Stable Values – a new Java 25 upcoming feature (JEP 502) enabling lazy initialization with immutable performance and JVM-level optimizations.