On Tue, May 26, 2009 at 2:38 PM, Simon Laws <[email protected]> wrote:
> On Tue, May 26, 2009 at 2:00 PM, ant elder <[email protected]> wrote:
>> I've started looking at Tuscany integration with Tomcat again and
>> created a new 2.x tomcat distribution in the distribution/tomcat
>> folder. That creates a war that can be deployed into Tomcat which
>> makes embedding Tuscany into Tomcat really easy - just deploy the war,
>> go to http://localhost:8080/tuscany and click install, and then
>> restart Tomcat. Thats it, and then you can use SCA in web applications
>> without needing to include the Tuscany runtime with each web
>> application.
>>
>> If you want to give it a try without building it yourself the
>> tuscany.war is available at:
>> http://people.apache.org/~antelder/tuscany/tomcat/tuscany.war
>> and there is a helloworld sample which uses SCA without including
>> Tuscany at: 
>> http://people.apache.org/~antelder/tuscany/tomcat/sample-helloworld-jsp.war
>>
>> This seems quite cool to me, and with potential for helping with lots
>> of things in 2.x such as using multiple Nodes, endpoints, dynamic
>> domains, backward compatibility etc. It also helps with making
>> portable samples that can easily be used in other SCA runtimes because
>> as the samples don't need to include Tuscany they should run as-is on
>> Tomact, or Geronimo with the Tuscany plugin, or WebSphere, etc.
>>
>> Comments?
>>
>>   ...ant
>>
>
> Hi Ant
>
> Interesting. Can you say something about what is happening under the
> covers? For example, what is the mapping between deployed wars and
> Tuscany nodes?
>
> Simon
>

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.

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 that in place we could now start to change the way this works and
how the Nodes are used. For example, the tuscany webapp could include
both 1.x and 2.x runtimes and configure webapps to use either
depending on the namespace of the sca-contributions.xml file. We could
add some sca domain configuration to Tomcat so webapps get associated
with a domain and have the Node configured to be part of that domain,
and use the endpoint facilities to do cross webapp wiring of sca
services and references.

  ...ant

Reply via email to