Implementing a timer on server for jobs?

381 views Asked by At

I am currently working on a bidding system for a university project. A user can create an auction. The user has to enter the many info concerning the auction including starting time and ending time. But how to know when the auction has end.

I am thinking of creating a timer on the server for every auction so that a timer is trigerred for every auction.

The server implementation is on java

2

There are 2 answers

0
adrianboimvaser On

Check out Quartz Scheduller, it may be useful for your purposes.

0
Joeri Hendrickx On

I hope I understood this correctly; you're asking how to know if the auction has ended.

I guess that would be

public boolean hasEnded(){
  return getEndTime().compareTo(new Date()) < 0;
}