JEE 7: WebSockets
Vít Koma
Solutions
- Comet
- streaming
- polling
- long polling
- Java applets
- WebSockets
WebSockets
-
Full-duplex communication
- API + protocol
- Part of HTML5
- Implemented in browsers and web servers
WebSockets in Java
- JSR 356 (part of JEE 7)
- Uses annotations
- Endpoint is POJO (@ServerEndpoint)
- Annotated methods handle events
-
@OnOpen,
- @OnClose,
- @OnMessage
- etc.
Other Features
- State management (session)
- Path parameters
-
Programmatic Endpoints
-
Encoders and Decoders
-
Full CDI support
-
HttpSession access
-
Standard webapp security
JEE 7: WebSockets
By Vit Koma