The moose likes EJB and other Java EE Technologies and the fly likes Doubt in EJB3/Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Doubt in EJB3/Annotation" Watch "Doubt in EJB3/Annotation" New topic

Doubt in EJB3/Annotation

Rakesh Rajagopalan
Ranch Hand

Joined: Sep 19, 2006
Posts: 59
Hi all,

I have a very fundamental doubt in EJB 3/Annotation. How does using �@Stateless� annotation transforms a Java Object to a Stateless bean? Can someone explain whats going on behind the scenes?

Reza Rahman
Ranch Hand

Joined: Feb 01, 2005
Posts: 580

The exact low-level details depends on the implementation. From a high-level, the container reads the bean configuration, attaches requested container services (e.g. transactions, DI, life-cycle callbacks, thread-safety, pooling, remoting, interceptors) to the POJO and makes the EJB available via the JNDI registry for other Java EE components.

Is there a specific problem you are trying to solve?

[ December 03, 2008: Message edited by: Reza Rahman ]

Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Rakesh Rajagopalan
Ranch Hand

Joined: Sep 19, 2006
Posts: 59
No Reza, there is no specific problem that im trying to solve. Just wanted to figure out how annotations are working. Thanks for replying.
Jerwin Louise Uy
Ranch Hand

Joined: Oct 27, 2007
Posts: 75

If you have doubts on the annotations, then you could try looking at the source code of the application server as well as the libraries assigned to process the annotations.

Based on my experience using EJB 3.0 (Toplink), dependency injection, class level and method level annotations seems to work fine.


Uy Jerwin Louise Vergara
Junior Developer / Research and Development at Incuventure Partners Corporation
I agree. Here's the link:
subject: Doubt in EJB3/Annotation
It's not a secret anymore!