• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about Tomcat capabilities, triggers

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I was recently introduced to Tomcat, so I don't have a lot of experience in that department.
As I have understood Tomcat is stateless.

But I am still wondering if there is a possibility to add triggers of some sort?
Like its able to execute a method in every 24 hours or something similar?(e.g. threads and timers?)

Any help is appreciated.

Best Regards,
Axel.R
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to involve Tomcat, check out the java.util.Timer and TimerTask classes. You can set those up in a context listener of your web app.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Axel!

I suppose that you could describe Tomcat as "stateless". I never considered it in that light.

Tomcat isn't really the ideal container for non-web tasks. It does have the advantage of being a central nexus for different types of work, but that's about its only virtue for non-web functionality. You would be better off considering a simple non-web container such as a workflow engine, Enterprise Service Bus or OSGi container (these things tend to overlap). A place where I used to work used an Inversion of Control-based container descended from Apache's Avalon project. There were a whole raft of these things, although most of them have faded away now, and I never discovered what was supposed to fill the vacancy.

For scheduling, there's Quartz or the OS "cron" facility (Windows has a similar scheduler).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic