Well, what I am trying to achieve is as follows: I am trying to load certain custom configurations from a file which is similar to web.xml in Tomcat, for each Context. We can define it globally and also override the configurations at context level. For this I have already created a custom Listener and have added it to lib folder.
I have already constructed it in a manner in which for each configuration the configurations are loaded at webapp deployment. But now I intend to perform this task not only at the initial deployment, but also if someone makes a change to the webapp. I believe Tomcat also dynamically reloads a context if modified, for example a modification to the web.xml or a Java class. We don't have to switch off the Tomcat server and restart it to load the new changes. In my understanding, in such a situation the Context instance that was initially created at server startup is destroyed and a new Context instance is created. I got this idea as I did not come across a new event type under Tomcat component lifecycle which defines an event of updating a Tomcat component such as a Context. The ones that exist are for starting and destroying of Tomcat components. Is my understanding correct? Or is it different? Plus what is/are the most appropriate LifeCycle events which I am to use in such a situation? On Sat, Feb 27, 2016 at 6:17 PM, Mark Thomas <ma...@apache.org> wrote: > On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis < > chirangaal...@gmail.com> wrote: > >Well, sorry if the question is not clear. > > > >What I want to know is for what type of event we need to listen in > >order to > >carry out a task when a Context is modified. It would be great if there > >is > >a clear explanation on how this is to be checked. > > Again, define modified. > > Again, why do you want to run a task? What are you actually trying to > achieve? > > Mark > > > > >On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas <ma...@apache.org> wrote: > > > >> On 26/02/2016 11:44, Chiranga Alwis wrote: > >> > Hi, > >> > > >> > I have currently created a LifecycleListener which listens to > >Tomcat's > >> > context deployment event and loads data in a custom configuration > >file at > >> > that point. > >> > > >> > I have been trying to find out whether LifecycleListeners support > >context > >> > update and modification events but yet in my understanding I could > >not > >> > discover an appropriate resource to use. > >> > >> Define update. > >> > >> Define modification. > >> > >> Better still, explain what it is you actually want to achieve rather > >> than ask for help implementing your, potentially flawed, solution. > >> > >> Mark > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >> For additional commands, e-mail: users-h...@tomcat.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >