On Wed, 2 Jul 2003, Angus Mezick wrote:

> Date: Wed, 2 Jul 2003 15:08:33 -0400
> From: Angus Mezick <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: How to get the container within an instance event?
>
> Does anyone know how to access the container object from an instance
> event?  Are there any specs that say an instance event can have no
> internal access to the server?
>

I presume you're talking about org.apache.catalina.InstanceEvent, right?
If so, the "wrapper" property that is accessible via getWrapper() is the
org.apache.catalina.Container instance for this particular servlet.  If
you want the Context element for the webapp, for example, you'd say
something like:

  Context context = (Context) event.getWrapper().getParent();

or, to get the Host for this virtual host:

  Host host = (Host) event.getWrapper().getParent().getParent();

and so on.

> Sorry for the cross post but I am deep into the internals of tomcat here
> and I don't know which list is appropriate.  The list with "how do I
> change the default port" type q's or the one that debates how features
> should be implemented.
>

The TOMCAT-USER list probably won't have many folks that understand the
internals well enough to answer a question like this :-).

> Angus Mezick
> GuideStar - Philanthropic Research Inc.
> 427 Scotland St.
> Williamsburg, Virginia 23185
> PHONE: (757)299-4631 x35  FAX:(757)229-8912
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> www.guidestar.org <http://www.guidestar.org>
>

Craig McClanahan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to