Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site r开发者_JAVA技巧esource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this questionI am looking for java library or open source that will do the following:
Accept a Runnable
task, and a specific time to execute it in the future, and execute it then.
Do you know such?
You can use the java.util.Timer
class to run a java.util.TimerTask
. TimerTask imlements the Runnable interface
You mean something like scheduler? Try Quartz (doesn't use Runnable
but Job
).
Or try Java's ScheduledThreadPoolExecutor.
Its already there in your standard JDK: TimerTask
I'm not sure if it's the software or the code you need but if it's just running a task you need then you could probably use CRON for *nix based systems and Task Scheduler for Windows.
精彩评论