You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Angus Mezick <am...@guidestar.org> on 2003/07/02 21:08:33 UTC

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? 

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.

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

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


Re: How to get the container within an instance event?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 2 Jul 2003, Angus Mezick wrote:

> Date: Wed, 2 Jul 2003 15:08:33 -0400
> From: Angus Mezick <am...@guidestar.org>
> Reply-To: Tomcat Developers List <to...@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 <ma...@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


Re: How to get the container within an instance event?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 2 Jul 2003, Angus Mezick wrote:

> Date: Wed, 2 Jul 2003 15:08:33 -0400
> From: Angus Mezick <am...@guidestar.org>
> Reply-To: Tomcat Developers List <to...@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 <ma...@guidestar.org>
> www.guidestar.org <http://www.guidestar.org>
>

Craig McClanahan

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