You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jakob Hummes <hu...@castify.net> on 2000/09/11 18:36:42 UTC
Embedded Tomcat
Hi,
Short question: are there any gotchas that I should be aware about,
before trying to instantiate Tomcat within my own proprietary framework?
Longer Explanation:
We have created a framework in which we can plug-in our own modules.
Each module is loaded by a classloader within the framework, and
instantiated. I want to deploy Tomact as one of those modules (probably
loaded by an own wrapper to set some proprietary config infos).
When I update the modules of the framework, I first unload the classes,
then load the new classes and instantiate them. One gotcha could exist,
if Tomcat would do a System.exit() when sending a shutdown request.
Other gotchas still to explore ;-)
So, please let me know, if you know about code, which would make this
task complicated...
Thanks in advance,
- Jakob
Re: Embedded Tomcat
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Jakob Hummes wrote:
> Hi,
>
> Short question: are there any gotchas that I should be aware about,
> before trying to instantiate Tomcat within my own proprietary framework?
>
> Longer Explanation:
> We have created a framework in which we can plug-in our own modules.
> Each module is loaded by a classloader within the framework, and
> instantiated. I want to deploy Tomact as one of those modules (probably
> loaded by an own wrapper to set some proprietary config infos).
> When I update the modules of the framework, I first unload the classes,
> then load the new classes and instantiate them. One gotcha could exist,
> if Tomcat would do a System.exit() when sending a shutdown request.
> Other gotchas still to explore ;-)
> So, please let me know, if you know about code, which would make this
> task complicated...
>
One approach to consider when embedding Tomcat is to forego the normal
startup main program class (org.apache.tomcat.startup.Tomcat) and do your
own initialization of the various components. There is a convenience class
included in Tomcat (org.apache.tomcat.startup.EmbededTomcat) that is used
for this purpose by the J2EE reference implementation, which embeds Tomcat,
in order to allow the server to control the entire environment.
The equivalent class for Tomcat 4.0 is org.apache.catalina.startup.Embedded
(which will be used by the J2EE 1.3 RI).
>
> Thanks in advance,
> - Jakob
Craig McClanahan
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
Applications to Tomcat