Hi,
we needed the same functionality and I solved it with an own
Interceptor. You could inherit from BaseInterceptor and than you get
various callbacks (engineInit, engineShutdown etc). But I don't know if
this Interface/Class changes in newer versions of tomcat, we use 3.2.1.
Another posibility is, you write a servlet and move your startupcode in
the init-Method and the shutdowncode in the destroy-Method and set
'load-on-startup' in your web.xml-file. But these Methods could be
called if the servlet-environment decides to kill an unused Servelt if
it gets low on resources. But I don't know if tomcat behaves likes this.
Because of the ClassLoader the loaded Classes of your Servlet are only
visible in the containing webapp.
Hope this helps, bye
Bernd
Zsolt Koppany wrote:
>
> Hi,
>
> as the subject shows is it possible that tomcat calls a class when
> tomcat is just started or when it is shutting down?
> My application needs database and some other external resources and it
> would be nice if I could control those resources depending on the status
> of tomcat.
>
> Zsolt
>
> --
> Zsolt Koppany
> Intland GmbH www.intland.com
> Schulze-Delitzsch-Strasse 16
> D-70565 Stuttgart
> Tel: +49-711-7871080 Fax: +49-711-7871017
--
Dipl.-Inform. Bernd Koecke
UNIX-Entwicklung
Schlund+Partner AG
Fon: +49-721-91374-0
E-Mail: [EMAIL PROTECTED]