Hi, 

I have a slight problem....
 
I am starting up a thread when application starts with a ServletContextListener 
implementation. The purpouse of the thread is to monitor a directory that has few xml 
descriptor files in it.
Attributes from the XML files are parsed into the ServletContext on startup of the 
ServletContext, and then it's possible to trigger reload by executing a servlet, that 
does the reload.

Right now the initial load and the reload by servlet are working, The thread is 
monitoring the directory every 10 seconds it checks if anything has been modified 
(works fine). 

The problem I am facing right now is to find a way to pass the attributes read by the 
Thread (instanciated in a listener) from the xml files,  into the ServletContext.

One way of doing it might be to run a HTTPUrlConnect against the servlet that can then 
reload the attributes from the xml files, that might work, but then I will have to 
worrie about some authentication, etc. That I dont want to have to think about right 
now.  

I tried passing a ServletContext variable  to the ServletContext to the Thread, but 
that seems to lock up the webapplication, meaning the thread runs fine but nothing 
else. 

I'm tired and I think I must be not thinking straight, can someone help me ?  :)

Thanx
-reynir







Reply via email to