tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: How to get the container within an instance event?
Date Thu, 03 Jul 2003 03:50:03 GMT


On Wed, 2 Jul 2003, Angus Mezick wrote:

> Date: Wed, 2 Jul 2003 15:08:33 -0400
> From: Angus Mezick <amezick@guidestar.org>
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org, tomcat-dev@jakarta.apache.org
> 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
> amezick@guidestar.org <mailto:amezick@guidestar.org>
> www.guidestar.org <http://www.guidestar.org>
>

Craig McClanahan

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message