Hi Guys,
I'm a wee bit confused - I was looking for the XML Syntax for the
InstanceListener, not how it's
being used within the default context.
I've tried the following in server.xml (within a Context definition):
<InstanceListener>
my.instance.listener
</InstanceListener>
And this works fine, however it doesn't match the other more familiar
constructs
within server.xml, something similar to:
<InstanceListener
className=my.instance.listener
debug="99">
</InstanceListener>
I was just curious as to what, if any, xml exposed options were available
for InstanceListener.
And again, I'm still wondering if it's possible to have an Engine or Host
level instance listener be applied
to all Contexts (where the context doesn't have an Instance entry of it's
own).
How is DefaultContext used? Is it used in the case where there is not a
Context entry for a war file being served
by tomcat?
Either way, it looks to me that, if I want to handle before/after events for
any given servlet, I need to specifically add
an InstanceListener to each and every Context.
Does anyone know of an alternative way of catching the before and after
stages of servlet init, service and destroy?
In tomcat 3.2 I just used a specialized Interceptor (which nicely applied to
all contexts) this new way is a bit awkward...
Hmm... maybe I can add a InstanceListener list to the parent container(s)
and, in the code that handles the current
InstanceListener processing, in the absence of there being a ContextLevel
InstanceListener, I could go up the hierarchy looking for
Instance listeners to invoke.
Any thoughts if that makes sense - or am I likely to get in trouble with
class loading (Context level vs. host & Engine level)...
-Thom
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Glenn Nielsen
Sent: Tuesday, July 10, 2001 6:16 AM
To: [EMAIL PROTECTED]
Subject: Re: InstanceListener syntax?
Remy Maucherat wrote:
>
> > Hi folks,
> >
> > can someone give me the definitive syntax for the InstanceListener?
> > Also, is it possible to setup an Engine (or Host) level InstanceListener
> > that would get applied to all context's within said Engine or Host?
> >
> > Having to add a InstanceListener to every context just to get the old
> > tomcat 3.2 pre/post Lifecycle event (Init,service,destroy) support is a
> > bit onerous.
>
> Glenn, would the default context help here ?
>
> Remy
Its in the code for DefaultContext, but I don't know if it has been tested.
Glenn
----------------------------------------------------------------------
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder |
MOREnet System Programming | * if iz ina coment. |
Missouri Research and Education Network | */ |
----------------------------------------------------------------------