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 AuctionMgmt
public void initTimers(long delay)
initTimers
in interface AuctionMgmt
public void initTimers(ScheduleExpression schedule)
initTimers
in interface AuctionMgmt
public void closeBidding(long itemId) throws MarketException
closeBidding
in interface AuctionMgmt
MarketException
public Bid getWinningBid(long itemId) throws MarketException
getWinningBid
in interface AuctionMgmt
MarketException
private AuctionItem makeDTO(AuctionItem item, Bid bid)
public void execute(Timer timer)
public int checkAuction() throws MarketException
checkAuction
in interface AuctionMgmt
MarketException
protected void publishAvailableItem(Session session, AuctionItem item) throws JMSException
JMSException
public void removeBid(long bidId) throws MarketException
removeBid
in interface AuctionMgmt
MarketException
public List<AuctionItem> getItems(int index, int count) throws MarketException
getItems
in interface AuctionMgmt
MarketException
public void removeItem(long id) throws MarketException
removeItem
in interface AuctionMgmt
MarketException
private 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 AuctionMgmtRemote
count
- number of tasks to performpublic void workAsync(int count, long delay)
workAsync
in interface AuctionMgmtRemote
count
- number of tasks to performCopyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.