This chapter is more of super quick reference for those who are busy Googling for answers like,
- "when was this annotation introduced ?"
- "can I use this annotation with this EJB type ?"
- "what's up with the latest version of EJB 3.x ..?"
- "which annotation(s) is/are useful for a specific feature I am interested in ?"
You can easily find answers to these common questions since this information has been conveniently sub-divided into logical categories.
- As per Java EE version - Java EE 5/6/7
- As per EJB type - Stateless, Stateful, Message Driven, Singleton, common to all
- As per EJB feature - the central theme of this book
Categorization as per Java EE version
This section presents all the EJB annotations as per their respective release version.
Only EJB 3.x releases (Java EE 5 and later) have been covered
Java EE 5 was where it all began - ease of use was driven by POJO based declarative programming model and the annotations were largely responsible for this recarnation. Here is a snapshot
Building further on the simplified model put forth in EJB 3.0, the 3.1 version introduced richer features and made things even easier
EJB 3.2 (Java EE 7)
Although there were some improvements to the EJB specification as part of the 3.2 (Java EE 7) release, new annotations were not added.
New in EJB 3.2
- Sensible defaults for local interfaces: From version 3.2 onwards,
EJBs implementing other (java) interfaces are assumed (by default)
to be exposing a local view (
@javax.ejb.Local) as opposed to forcing the implementation class (EJB) to specify the exact view type (
EJBContainerAPI now supports try-with-resources (JDK 7) feature
Statefulbeans passivation has been made optional
TimerServiceAPI has been enhanced to add a
getAllTimersmethod which returns all the timers configured within that EJB module
- Improvement to Message Driven Beans
- The following parts of the EJB specification have now been made optional - entity beans, EJB QL and JAX-RPC
Categorization as per EJB types
EJBs can be divided into four major types - Stateless, Stateful, Message Driven and Singleton. This section categorizes annotations as per their applicability to specific type of EJBs and also highlights the ones which are commonly used across all EJBs in general.
Categorization as per EJB features
The below diagram should give you a quick yet clear overview of EJB features. This along with the rest of the information in this chapter should hopefully set you up for the upcoming content
Up next ...
Time to dive in ....!