Java Magazine, May/June 2018
ORACLE COM JAVAMAGAZINE MAY JUNE 2018 60 design patterns getters Java EE ships with functionality that allows you to fire and observe events with loose coupling namely CDI events CDI events are fired during the execution of the business logic @ Stateless public class InstrumentCraftShop @ Inject InstrumentMaker instrumentMaker @ Inject Event ElectricGuitarCrafted instrumentCreated @ PersistenceContext EntityManager entityManager public ElectricGuitar craftInstrument ElectricGuitar instrument instrumentMaker build instrumentCreated fire new ElectricGuitarCrafted instrument getModel return entityManager merge instrument retrieveInstrument CDIs Event T type is injected into managed beans and is used to fire any defined events such
You must have JavaScript enabled to view digital editions.