- I need to built a thread/process that is always running, and can be queried through other servelts and JSP pages…
- This thread/process will be dealing with large files, so it will cache file blocks to reduce file accesses (plus some other processing)…
- So, that thread/process will be loaded and waiting for any queries coming, to answer… as long as the server is running.
I though about making a static class common between all the servelt classes, but I found out that will not work (tomcat deals with each new servelt as a totally new program)
So what are the other options I can try??
I think you have two options:
ServletContextto access application-wide scope objects.