• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to find a way to run a class on specific date/time  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make one shell task with java servlet that my class will Check user expiration date if this is expired then it will start sending 5 different steps messages before 5 weeks i.e. each step message in every week to remind him for renewal

Kindly help me to know how I set some trigger type thing to run this class auto

Thanks & best regards
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you mean by "shell task", but you can schedule tasks using java.util.Timer and TimerTask classes. In a web app, the best place to set those up would be in a context listener during web app startup.
 
Maximus Moothiringus
Ranch Hand
Posts: 46
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he might be talking about a Unix Cron job.

But great thing with the Timer class, something that I was not aware of. Something more to experiment with.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Not sure what you mean by "shell task", but you can schedule tasks using java.util.Timer and TimerTask classes. In a web app, the best place to set those up would be in a context listener during web app startup.


Thanks from bottom of my heart
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!