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 AuctionMgmtActionEJB
actions
private AuctionItemDAO
auctionItemDAO
(package private) long
checkItemInterval
private DtoMapper
dtoMapper
private JMSContext
jmsContext
private static org.slf4j.Logger
logger
private Destination
sellTopic
private TimerService
timerService
-
Constructor Summary
Constructors Constructor Description AuctionMgmtEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
protected void
publishAvailableItem(AuctionItem item)
void
removeBid(long bidId)
void
removeItem(long itemId)
void
workAsync(int count, long delay)
Perform action async from this callervoid
workSync(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:
cancelTimers
in interfaceAuctionMgmt
-
initTimers
public void initTimers(long delay)
- Specified by:
initTimers
in interfaceAuctionMgmt
-
initTimers
public void initTimers(ScheduleExpression schedule)
- Specified by:
initTimers
in interfaceAuctionMgmt
-
closeBidding
public void closeBidding(long itemId) throws ResourceNotFoundException
- Specified by:
closeBidding
in interfaceAuctionMgmt
- Throws:
ResourceNotFoundException
-
getWinningBid
public Bid getWinningBid(long itemId) throws ResourceNotFoundException
- Specified by:
getWinningBid
in interfaceAuctionMgmt
- Throws:
ResourceNotFoundException
-
execute
public void execute(Timer timer)
-
checkAuction
public int checkAuction()
- Specified by:
checkAuction
in interfaceAuctionMgmt
-
publishAvailableItem
protected void publishAvailableItem(AuctionItem item) throws JMSException
- Throws:
JMSException
-
removeBid
public void removeBid(long bidId) throws ResourceNotFoundException
- Specified by:
removeBid
in interfaceAuctionMgmt
- Throws:
ResourceNotFoundException
-
getItems
public List<AuctionItem> getItems(int index, int count)
- Specified by:
getItems
in interfaceAuctionMgmt
-
removeItem
public void removeItem(long itemId)
- Specified by:
removeItem
in interfaceAuctionMgmt
-
workSync
public void workSync(int count, long delay)
Perform action synchronously while this caller waits- Specified by:
workSync
in interfaceAuctionMgmtRemote
- Parameters:
count
- number of tasks to perform
-
workAsync
public void workAsync(int count, long delay)
Perform action async from this caller- Specified by:
workAsync
in interfaceAuctionMgmtRemote
- Parameters:
count
- number of tasks to perform
-
-