On Tue, May 26, 2009 at 5:49 PM, Raymond Feng <[email protected]> wrote: > See my comments inline. > > -------------------------------------------------- > From: "ant elder" <[email protected]> > Sent: Tuesday, May 26, 2009 6:56 AM > To: <[email protected]> > Subject: Re: Tuscany Tomcat integration > > [[snip]] > >> >> The tuscany.war includes the Tuscany runtime inside the webapp but in >> separate folders (tomcat-lib and tuscan-lib) and clicking the install >> button updates the tomcat conf/server.xml file to add those folders to >> the tomcat system classpath and adds a tuscany lifecycle listener to >> the tomcat runtime. Then when webapps are being started Tuscany >> intercepts the start and looks for the presence of a web.composite or >> sca-contribution.xml in the webapp and if so dynamically adds the >> tuscany runtime jars to the webapp classpath and adds the Tuscany >> listener and filter to the webapp. > > Using a webapp to install/uninstall sounds interesting. > > If the jars are added to the system classpath, why do we have to update the > webapp classpath? Are the Tuscany classes shared by all of the webapps or > each webapp has their own copy (separate classloader)? >
The tuscany runtime jars are not on the system or shared classpath, only the one tuscany-tomcat-hook jar in the tuscany webapp tomcat-lib folder is on the tomcat system classpath, the jars in the tuscany-lib get added to the application classpath only for sca enabled webapps. > http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html > >> >> The result of that is just the same as if the webapp had included the >> tuscany jars within its web-inf/lib and had the Tuscany listener and >> filter defined in its web.xml. So right now that means a sinlge >> standalone Node is started for each webapp just the same as with the >> existing Tuscany webapp support. > > With the recent enhancement that multiple nodes can be started in the same > JVM, we can install the Tuscany jars into the Tomcat common lib so that the > runtime can be shared by the webapps. > Yes that can be done (and it also works with the old 1.x webapp support) but its a different scenario. That just means there's only one copy of the tuscany jars but each webapp still needs to be "tuscany enabled", ie have each web.xml include the tuscany specific listener and filter definitions, and it has the limitation that we can't do SCA injection into JEE artifacts like servlets which the deep integration will allow. ...ant
