Enterprise JavaBeans 3.1 with Contexts and Dependency Injection: The Perfect Synergy - 0 views
-
stateless EJB 3.1 bean as boundary (Facade)
- ...22 more annotations...
-
Annotating the boundary (Cart) with the @Named annotation makes the Cart immediately visible for expression language (EL) expressions in JSP and JSF
-
@Named annotation takes the simple name of the annotated class, puts the first character in lowercase, and exposes it directly to the JSF pages (or JSP). The Cart bean can be accessed directly, without any backed or managed beans, by the JSF pages: <h:commandButton value="Check out!" action="#{cart.checkout}" />
-
class Event can be considered to be a lightweight alternative to the java.beans.PropertyChangeSupport class
-
The during attribute in the @Observes annotation allows you to select in which transactional phase the event gets delivered. The default setting is IN_PROGRESS, which causes an immediate event delivery regardless of the transaction outcome. The AFTER_SUCCESS configuration causes the delivery to occur only after successful transaction completion
-
Although CDI events work only inside a single process (in the default case, CDI is extensible), they are perfectly suitable for decoupling packages from modules
-
The method checkout() starts a transaction that gets "reused" by the OrderSystem and CustomerNotification session beans
-
ordering.placeOrder(); notifier.sendNotification();