Can we automatically install the Tuscany when the tuscany.war is started for
the first time?
Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Wednesday, May 27, 2009 12:03 AM
To: <[email protected]>
Subject: Re: Tuscany Tomcat integration
On Tue, May 26, 2009 at 6:28 PM, ant elder <[email protected]> wrote:
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
And of course the other big benefit of this is that it provides a
useful place to work on the domain story - having multiple Nodes wired
together so you can have sca references in one webapp wired to sca
services in another webapp or sca contribution. Thats something users
have ask for several times, and it would be a much more useful and
compelling demonstration of the sca domain than just a couple of JSE
nodes talking to each other.
What i'd like to get to with this would be to have the this
tuscany.war include a domain manager application along with the
installer app, and to be able to create and manage domains, install
sca contributions, and assign sca webapps to domains. It would also be
nice if the tuscany.war web pages looked like the Tuscany website
pages so use the tuscany website CSS etc. If anyone would like to help
with any of this that would be wonderful and i'd be happy to help you
get started.
...ant