开发者

Job Scheduling in Java

I want to run a Java program on a specific date. I am developing a J2EE application that allows you to schedule Selenium test launch (JUnit) on a specified date..

Are there any solutions to do this? can you point me to technology that can help me to do this? any 开发者_开发知识库help is appreciated:) thanks for your help


You provided very little information. You can schedule launch in scheduler of your operating system (like cron in Linux), or you can run a task from within your Java process, if the process is constantly running. For this see Quartz Scheduler.


Not knowing enough details, I would recommend using Quartz. You can see an example of using it here.


You could use crond or Windows Task Manager.


If you have a Java process running from now to the time it needs to start, look at Quartz.

If you need to have a Java process started from nothing, you must ask your operating system to invoke it for you. For Linux check the "at" command.


Cron on Unix, and Cron for NT on WindowsNT platforms (XP-Windows 7, Windows Server 4.0+).

Why reinvent the wheel?


If you want to create and package modular java server-side tasks (that you can then schedule in any particular java scheduler of your choice) check out the open source project called soafaces. Let's you create modular java Tasklets and also give them web based GUI customizer (customizer part is optional and based on google gwt).


Scheduling can be implemented in many ways, it is also bit IO intensive, so if needed u might want to use non-java solutions

However you want to have java solutions may be below links should help you

Spring Way : https://spring.io/guides/gs/scheduling-tasks/ and https://dzone.com/articles/schedulers-in-java-and-spring

Non Spring solution: https://github.com/knowm/Sundial

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜