users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] SFSBs as Websocket endpoints and EJB spec

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Fri, 11 Jan 2013 15:31:42 -0800

Experts,

Java API for Web Socket
(http://java.net/projects/websocket-spec/downloads/directory/Spec%20javadoc%20Drafts/v011%20-%20Public%20Draft)
lists SFSB as an option for the websocket endpoint. SFSB is indeed the
best match between various session bean types for the websocket endpoint
as it maps nicely into the endpoint lifecycle, with singleton being the
next best thing (using Lock(READ) to allow for truly concurrent
conversations), and SLSBs being distant third (for the cases where
concurrency is more important than carrying the state between the calls).

This is the brief description from the Web Socket spec lead, Danny
Coward, on the subject:

"We would very much like to allow web socket developers to write
websocket endpoints using EJBs. We have identified that it makes sense
to allow websocket developers to use either stateless or stateful
session beans as well as singletons. There is a particularly good match
for stateful session beans with the typical websocket use cases."


Currently EJB spec doesn't say anything about EJBs being used by JAX-RS
(nor the Web Socket), the correspceptorsonding specs do (but while they
do so, they do not cover e.g. if and how the interceptors are executed
on the bean methods, and what constitutes the client view of such bean).

Do you think that EJB spec should:
a) just acknowledge such use cases, and include Web Socket in this
acknowledgement
b) describe in details the client view, interceptors, etc., similar to
the web services endpoint descriptions
c) continue to be mum about those use cases

thanks,
-marina

P.S. The second part of this discussion is about SFSB lifecycle (in
particular destruction rules) and will continue on the thread "enabling
bean-level retainIfException?"
(http://java.net/projects/ejb-spec/lists/jsr345-experts/archive/2012-12/message/16).