Package ejava.examples.asyncmarket.ejb
Class BuyerMDB
- java.lang.Object
-
- ejava.examples.asyncmarket.ejb.BuyerMDB
-
- All Implemented Interfaces:
MessageListener
public class BuyerMDB extends Object implements MessageListener
This class will listen for market events and cause further bidding to occur. Note that this is mostly a technology demonstration and not a great architectural demonstration. It would be best to restrict this class to only the async/JMS interface and move all detailed processing and business logic to lower level classes. Architecturally, MDBs should be restricted to just interface adaption. If you place too much business logic here it becomes harder to test and reuse.
-
-
Field Summary
Fields Modifier and Type Field Description private AuctionMgmtLocalauctionMgmtprivate BuyerLocalbuyerprivate MessageDrivenContextctxprivate static org.slf4j.Loggerloggerprivate OrderDAOorderDAO
-
Constructor Summary
Constructors Constructor Description BuyerMDB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()voidonMessage(Message message)protected voidprocessAuctionItem(long itemId)protected voidprocessOrder(Order order)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
buyer
private BuyerLocal buyer
-
auctionMgmt
private AuctionMgmtLocal auctionMgmt
-
ctx
private MessageDrivenContext ctx
-
-
Method Detail
-
init
@PostConstruct public void init()
-
onMessage
@PermitAll public void onMessage(Message message)
- Specified by:
onMessagein interfaceMessageListener
-
processAuctionItem
protected void processAuctionItem(long itemId)
-
processOrder
protected void processOrder(Order order)
-
-