Package ejava.examples.asyncmarket.ejb
Class AuctionMgmtEJB
- java.lang.Object
-
- ejava.examples.asyncmarket.ejb.AuctionMgmtEJB
-
- All Implemented Interfaces:
AuctionMgmt,AuctionMgmtLocal,AuctionMgmtRemote
public class AuctionMgmtEJB extends Object implements AuctionMgmtRemote, AuctionMgmtLocal
-
-
Field Summary
Fields Modifier and Type Field Description private AuctionMgmtActionEJBactionsprivate AuctionItemDAOauctionItemDAO(package private) longcheckItemIntervalprivate DtoMapperdtoMapperprivate JMSContextjmsContextprivate static org.slf4j.Loggerloggerprivate DestinationsellTopicprivate TimerServicetimerService
-
Constructor Summary
Constructors Constructor Description AuctionMgmtEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelTimers()intcheckAuction()voidcloseBidding(long itemId)voidexecute(Timer timer)List<AuctionItem>getItems(int index, int count)BidgetWinningBid(long itemId)voidinit()voidinitTimers(long delay)voidinitTimers(ScheduleExpression schedule)protected voidpublishAvailableItem(AuctionItem item)voidremoveBid(long bidId)voidremoveItem(long itemId)voidworkAsync(int count, long delay)Perform action async from this callervoidworkSync(int count, long delay)Perform action synchronously while this caller waits
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
actions
private AuctionMgmtActionEJB actions
-
auctionItemDAO
@Inject private AuctionItemDAO auctionItemDAO
-
timerService
private TimerService timerService
-
checkItemInterval
long checkItemInterval
-
jmsContext
@Inject private JMSContext jmsContext
-
sellTopic
private Destination sellTopic
-
-
Method Detail
-
init
@PostConstruct public void init()
-
cancelTimers
public void cancelTimers()
- Specified by:
cancelTimersin interfaceAuctionMgmt
-
initTimers
public void initTimers(long delay)
- Specified by:
initTimersin interfaceAuctionMgmt
-
initTimers
public void initTimers(ScheduleExpression schedule)
- Specified by:
initTimersin interfaceAuctionMgmt
-
closeBidding
public void closeBidding(long itemId) throws ResourceNotFoundException- Specified by:
closeBiddingin interfaceAuctionMgmt- Throws:
ResourceNotFoundException
-
getWinningBid
public Bid getWinningBid(long itemId) throws ResourceNotFoundException
- Specified by:
getWinningBidin interfaceAuctionMgmt- Throws:
ResourceNotFoundException
-
execute
public void execute(Timer timer)
-
checkAuction
public int checkAuction()
- Specified by:
checkAuctionin interfaceAuctionMgmt
-
publishAvailableItem
protected void publishAvailableItem(AuctionItem item) throws JMSException
- Throws:
JMSException
-
removeBid
public void removeBid(long bidId) throws ResourceNotFoundException- Specified by:
removeBidin interfaceAuctionMgmt- Throws:
ResourceNotFoundException
-
getItems
public List<AuctionItem> getItems(int index, int count)
- Specified by:
getItemsin interfaceAuctionMgmt
-
removeItem
public void removeItem(long itemId)
- Specified by:
removeItemin interfaceAuctionMgmt
-
workSync
public void workSync(int count, long delay)Perform action synchronously while this caller waits- Specified by:
workSyncin interfaceAuctionMgmtRemote- Parameters:
count- number of tasks to perform
-
workAsync
public void workAsync(int count, long delay)Perform action async from this caller- Specified by:
workAsyncin interfaceAuctionMgmtRemote- Parameters:
count- number of tasks to perform
-
-