I'm just getting to grips with Java EE. I know that adding @Stateful
or @Stateless
annotations to a class will make it an EJB bean. But what is actually happening in the background once I do that? I see the following listed on Wikipedia in relation to EJBs.
See this answer for some insight on both questions.
The highlights to focus on in that answer are that:
Note, one thing I did miss in that answer was the entire @MessageDriven
concept.
It's very interesting you put JMS / Connector on the same line as that is exactly how they are implemented. Message-Driven Beans (MDBs) should actually be called "Connector-Driven Beans" as all communication and lifecycle of an MDB is actually tied to the Connector Architecture specification and has nothing to do with JMS directly -- JMS is just the only Connector people ever see. There's a great deal of potential there. Hopefully we'll see some improvements in Java EE 7.