Posted by
felipegaucho on June 2, 2009 at 1:19 PM PDT
After the impressive General Session, I attended a session about
EJB 3.1 - proposed to release on the third quarter of this year. There are tons of blogs with complete overview of the new EJB, but here are the fresh highlights from the session:
-
Optional local interface business interface
-
Packaging
-
EJB 3.1 Lite API
- Web profile (injection like Spring does)
-
No portability issue, works in Tomcat and Java EE containers,
for example.
-
only available for local EJBs (no MDB,
ws-endpoints, etc). Supposed to be a simplified and lightweight model.
-
Portable Global JNDI names
-
Portable Naming Syntax: every session bean gets the following
entries:
-
The lookup mechanism will look for the local and remote
interface (remember, the local is optional)
-
Globally unique name:
-
Unique name within the same application.
-
Unique name within defining module.
-
Testing EJBs
-
Embeddable API
-
New features
-
Singletons - designed for efficient concurrent access.
-
Startup / Shutdown callbacks.
-
Calendar-based timers: timeouts, automatic timer creation,
non.persistent timers. A cron-like semantics with improved
syntax. Automatic timer creation can be specified via annotations or
deployment descriptor (ejb-jar.xml).
-
@Asynchronous session bean invocations. Fire and
Forget or async results via Future<V>.
It is not available for MDB (for obvious reasons). Best ever delivers,
better than JMS for EJB calls (persitent delivery guarantee not
included in the spec).
@Asynchronous
public Future compute(Task t) { ... }
No transaction propagation from caller to callee.
-
JAX-RS integration (RESTful). Instead of using Jersey or other technology to expose a RESTful web-service, we can just expose the bean on the HTTP interface. That's really cool and IMO it will save a lot of boiler plate code.