• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How to pass values to spring schedular at run time?

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using spring scheduling example as shown below.



In above example the startDelay and repeatInterval is hardcoded in .xml file.
But my requirement is to pass these values at rune time.
Because these values are comming from web GUI used by Client.

Please help me.

Thanks
 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of task you want to schedule in the scheduler? I guess it is possible to read the value from property file instead of hard coding into XML file. 'Start time' and 'Repeat time' is read at that time of server startup so later on even if you change any of those values you got to restart the server to see the effect.

Generally, Scheduler is used to create a daemon process which will run forever until you stop the server. For example, it can be used to send the emails to all the ranchers who have put watch on some topic.

Hope it helps you.
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic