Java™ EE specification
makes the creation of EJB 3.1 applications simpler than previous EJB
specifications.
New in EJB 3.1 (JSR 318)
- Singleton beans (@Singleton)
- Before EJB 3.1, there was no easy way to share data throughout
the application; the EJB 3.1 Singleton is an application-wide singleton.
- Concurrency can be managed either by the container or by the
Bean Developer
Java EE streamlines EJB development
in the following ways:
- Fewer required classes and interfaces
- Home and object interfaces are no longer required – you need the
business interface only
- No need to implement javax.ejb.SessionBean
- No need to declare checked exceptions
- Optional deployment descriptors
- Annotations provide component definition and dependency injection
- Simple lookups
- new EJBContext() interface method replaces JNDI calls
- Lightweight persistence for object-relational mapping
- Entities are POJOs that provide an object-oriented view of the
data stored in relational database
- New Interceptors class (new in Java EE 5)
- Interceptors are objects that can intercept a call to a business
method (to handle security for example)
- Similar in purpose and action to Servlet filter or Web services
handler
- Provide limited form of aspect-oriented programming