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 AuctionMgmtLocal
auctionMgmt
private BuyerLocal
buyer
private MessageDrivenContext
ctx
private static org.slf4j.Logger
logger
private OrderDAO
orderDAO
-
Constructor Summary
Constructors Constructor Description BuyerMDB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init()
void
onMessage(Message message)
protected void
processAuctionItem(long itemId)
protected void
processOrder(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:
onMessage
in interfaceMessageListener
-
processAuctionItem
protected void processAuctionItem(long itemId)
-
processOrder
protected void processOrder(Order order)
-
-