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 AuctionItemDAO
auctionItemDAO
private SessionContext
ctx
private DtoMapper
dtoMapper
private JMSContext
jmsContext
private static org.slf4j.Logger
logger
private PersonDAO
sellerDAO
private Destination
sellTopic
private TimerService
timerService
-
Constructor Summary
Constructors Constructor Description SellerEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endAuction(long itemId)
AuctionItem
getItem(long itemId)
protected Bid
getWinningDTO(Bid winningBid, AuctionItem item)
void
init()
protected void
publishForSale(AuctionItem item)
protected void
publishSold(AuctionItem item)
long
sellProduct(String sellerId, AuctionItem item)
void
timeout(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:
sellProduct
in interfaceSeller
- Throws:
ResourceNotFoundException
-
publishForSale
protected void publishForSale(AuctionItem item) throws JMSException
- Throws:
JMSException
-
getItem
public AuctionItem getItem(long itemId) throws ResourceNotFoundException
- Specified by:
getItem
in 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
-
-