public class AuctionMgmtEJB extends Object implements AuctionMgmtRemote, AuctionMgmtLocal
| Modifier and Type | Field and Description |
|---|---|
private AuctionMgmtActionEJB |
actions |
private AuctionItemDAO |
auctionItemDAO |
(package private) long |
checkItemInterval |
private ConnectionFactory |
connFactory |
private EntityManager |
em |
private static org.apache.commons.logging.Log |
log |
private Destination |
sellTopic |
private TimerService |
timerService |
private PersonDAO |
userDAO |
| Constructor and Description |
|---|
AuctionMgmtEJB() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelTimers() |
int |
checkAuction() |
void |
closeBidding(long itemId) |
void |
execute(Timer timer) |
List<AuctionItem> |
getItems(int index,
int count) |
Bid |
getWinningBid(long itemId) |
void |
init() |
void |
initTimers(long delay) |
void |
initTimers(ScheduleExpression schedule) |
private AuctionItem |
makeDTO(AuctionItem item) |
private AuctionItem |
makeDTO(AuctionItem item,
Bid bid) |
private Bid |
makeDTO(Bid bid) |
private List<AuctionItem> |
makeDTO(List<AuctionItem> items) |
private List<Bid> |
makeDTO(List<Bid> bids,
AuctionItem item) |
private Person |
makeDTO(Person person,
Bid bid) |
protected void |
publishAvailableItem(Session session,
AuctionItem item) |
void |
removeBid(long bidId) |
void |
removeItem(long id) |
void |
workAsync(int count,
long delay)
Perform action async from caller.
|
void |
workSync(int count,
long delay)
Perform action synchronously while caller waits.
|
private static final org.apache.commons.logging.Log log
private EntityManager em
private AuctionMgmtActionEJB actions
private AuctionItemDAO auctionItemDAO
private PersonDAO userDAO
private TimerService timerService
long checkItemInterval
private ConnectionFactory connFactory
private Destination sellTopic
@PostConstruct public void init()
public void cancelTimers()
cancelTimers in interface AuctionMgmtpublic void initTimers(long delay)
initTimers in interface AuctionMgmtpublic void initTimers(ScheduleExpression schedule)
initTimers in interface AuctionMgmtpublic void closeBidding(long itemId)
throws MarketException
closeBidding in interface AuctionMgmtMarketExceptionpublic Bid getWinningBid(long itemId) throws MarketException
getWinningBid in interface AuctionMgmtMarketExceptionprivate AuctionItem makeDTO(AuctionItem item, Bid bid)
public void execute(Timer timer)
public int checkAuction()
throws MarketException
checkAuction in interface AuctionMgmtMarketExceptionprotected void publishAvailableItem(Session session, AuctionItem item) throws JMSException
JMSExceptionpublic void removeBid(long bidId)
throws MarketException
removeBid in interface AuctionMgmtMarketExceptionpublic List<AuctionItem> getItems(int index, int count) throws MarketException
getItems in interface AuctionMgmtMarketExceptionpublic void removeItem(long id)
throws MarketException
removeItem in interface AuctionMgmtMarketExceptionprivate List<AuctionItem> makeDTO(List<AuctionItem> items)
private AuctionItem makeDTO(AuctionItem item)
private List<Bid> makeDTO(List<Bid> bids, AuctionItem item)
public void workSync(int count,
long delay)
workSync in interface AuctionMgmtRemotecount - number of tasks to performpublic void workAsync(int count,
long delay)
workAsync in interface AuctionMgmtRemotecount - number of tasks to performCopyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.