0

I want run a background process at a specific time. I want that process to be run on the server even without running the application from End-User side. The application is made using Spring. Please suggest how to approach for it. Thanks and regards Souvik

5
  • what operation system? Commented Dec 3, 2014 at 9:15
  • 2
    Have you tried quartz-scheduler.org Commented Dec 3, 2014 at 9:17
  • 1
    Since you are using Spring you can also check at Spring Quartz Commented Dec 3, 2014 at 9:20
  • consider using quartz or java timer API Commented Dec 3, 2014 at 9:22
  • Is the program that you want to run as daemon already developped ?? Commented Dec 3, 2014 at 9:25

1 Answer 1

1

I depends highly on what platform you are working on, and what you want to achieve.

If it is a simple application, that you simply want to invoke that on specific time, then you can use scheduling tools available on your platform, for example, crontab for Unix, or scheduled task (at) for Windows.

If you want the application to be run as a daemon process, and the application itself will handle the scheduling, then you need to solve two problem: 1. create a daemon process (aka system service), and 2. doing scheduling in Java.

For problem 1, there are already answer for it. Just have a search on Google on "Java System Service" will give you some other useful tools too, like Java Service Wrapper

For problem 2, there are a lot of way to perform scheduling in Java. You can do it by built-in Timer etc, or using scheduling library like Quartz

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.