Package ejava.examples.asyncmarket.ejb
Class SellerEJB
- java.lang.Object
-
- ejava.examples.asyncmarket.ejb.SellerEJB
-
- All Implemented Interfaces:
SellerLocal,SellerRemote,Seller
public class SellerEJB extends Object implements SellerLocal, SellerRemote
-
-
Field Summary
Fields Modifier and Type Field Description private AuctionItemDAOauctionItemDAOprivate SessionContextctxprivate DtoMapperdtoMapperprivate JMSContextjmsContextprivate static org.slf4j.Loggerloggerprivate PersonDAOsellerDAOprivate DestinationsellTopicprivate TimerServicetimerService
-
Constructor Summary
Constructors Constructor Description SellerEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendAuction(long itemId)AuctionItemgetItem(long itemId)protected BidgetWinningDTO(Bid winningBid, AuctionItem item)voidinit()protected voidpublishForSale(AuctionItem item)protected voidpublishSold(AuctionItem item)longsellProduct(String sellerId, AuctionItem item)voidtimeout(Timer timer)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
jmsContext
@Inject private JMSContext jmsContext
-
sellTopic
private Destination sellTopic
-
timerService
private TimerService timerService
-
ctx
private SessionContext ctx
-
auctionItemDAO
@Inject private AuctionItemDAO auctionItemDAO
-
-
Method Detail
-
init
@PostConstruct public void init()
-
sellProduct
public long sellProduct(String sellerId, AuctionItem item) throws ResourceNotFoundException
- Specified by:
sellProductin interfaceSeller- Throws:
ResourceNotFoundException
-
publishForSale
protected void publishForSale(AuctionItem item) throws JMSException
- Throws:
JMSException
-
getItem
public AuctionItem getItem(long itemId) throws ResourceNotFoundException
- Specified by:
getItemin interfaceSeller- Throws:
ResourceNotFoundException
-
getWinningDTO
protected Bid getWinningDTO(Bid winningBid, AuctionItem item)
-
timeout
public void timeout(Timer timer)
-
endAuction
public void endAuction(long itemId) throws ResourceNotFoundException- Throws:
ResourceNotFoundException
-
publishSold
protected void publishSold(AuctionItem item) throws JMSException
- Throws:
JMSException
-
-