Thanks Mark, I will go through and try to understand this. If any
clarifications are required I will post here.

By the way the goal I am pursuing (if it is not clear) is to enable the
loading of a set of custom configurations for every Context. These
configurations cannot be included within the typical web.xml (as we intend
to separate out these custom configurations from the typical web.xml
configurations) Other that that, this file plays a similar role to that
played by the web.xml.

On Sun, Feb 28, 2016 at 3:04 AM, Mark Thomas <ma...@apache.org> wrote:

> On 27/02/2016 17:38, Chiranga Alwis wrote:
> > 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.
>
> You still haven't defined change.
>
> > 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?
>
> No.
>
> > Or is it different?
>
> Yes.
>
> > Plus what is/are the most
> > appropriate LifeCycle events which I am to use in such a situation?
>
> It appears you are using Tomcat 6 since that is the version of the
> documentation you quoted in your first post in this thread.
>
> You really need to upgrade to at least 7.0.x where the behaviour is much
> better defined. 6.0.x is likely to have some undocumented edge cases
> that might surprise you.
>
> Then you need to read this:
> http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html
>
> Pay particular attention to the differences between reload and redeploy.
>
> Then look at the Lifecyle.CONFIGURE_START_EVENT event.
>
> Mark
>
> >
> > 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
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to