• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

Java scheduler

We would like to schedule a job within the prog using a java APIs rather than the windows scheduler. Currently the Timer class in java enables us to schedule a job at regular intervals , but what I am looking for is to schedule a job at a particular time . like it should start everyday at 8 AM , please advice .
0
FranklinRaj22
Asked:
FranklinRaj22
2 Solutions
 
ErdyMurphyCommented:
0
 
CEHJCommented:
>>using a java APIs rather than the windows scheduler.

That's not a particularly good idea: unless you run the java app as a service, you'll find it all too easily shut down accidentally. An unreliable scheduler is useless
0
 
ErdyMurphyCommented:

public void scheduleAtFixedRate(TimerTask task, long delay,long period)
pherhaps you could start at 8 pm and set teh period for 24h
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Dejan PažinHead of SW DevelopmentCommented:

We are using Quartz for our job scheduling:

http://www.quartz-scheduler.org/

0
 
CEHJCommented:
>>We would like to schedule a job within the prog using a java APIs rather than the windows scheduler.

What are your reasons for that incidentally? I can understand if you want to be independent from the OS, but unfortunately, if you want safety and reliability, you can't be. You need a service

http://commons.apache.org/daemon/procrun.html
or
http://wrapper.tanukisoftware.com/
0
 
Amitkumar PSr. ConsultantCommented:
FranklinRaj22,

Follow dejanpazin and have look into Quartz schedular API. I've worked with and found it is very good from the result point of view as well as implementation point of view.
0
 
CEHJCommented:
Quartz is generally a good idea, but doesn't solve the problem: it generally runs in the context of a web application. Your use case sounds like a client-side one. If that's the case, Quartz itself would need to run as a Windows service.

Since you already have a windows scheduling service running, it seems a shame not to use it
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now