aspose file tools*
The moose likes Spring and the fly likes Spring Scheduler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Scheduler" Watch "Spring Scheduler" New topic
Author

Spring Scheduler

Jehan Jaleel
Ranch Hand

Joined: Apr 30, 2002
Posts: 196
Hi,

I have a Spring Batch job which I am triggering from a Spring Scheduler service running in Tomcat..

Java code..



XML...



My question is it a good idea to have "(fixedRate = 14400000)" hard coded in Java? Supposing we need to change the schedule on which the job runs or not to have the job run on a given day? Is there a better design to get around these restrictions?

Thanks.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

Well if its not going to change often I suppose its fine You can use a PropertySourcesPlaceholderConfigurer to load the value from a properties file and use SPEL to put it in.



Of course that is where it is expecting a String with yours I think it wants a long. It might do the type conversion for you, try it. If it does not you can get more creative with your SPeL and call the Long.valueOf() method on your property.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Scheduler
 
Similar Threads
Help with Spring Batch (Newbie)
jboss scheduler and spring framework
Running a batch
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
Quartz job stoping after some time