Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by edslattery:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/TomcatIntegration

New page:
Tuscany can be integrated into Apache Tomcat to provide transparent 
configuration of SCA Module Components contributed by web applications. The 
Tomcat installation can be configured once and from then on web applications 
will be able to use SCA facilities simply by including a sca.module file on the 
application classpath (in a JAR in WEB-INF/lib or in WEB-INF/classes).

= Initial Configuration =

The Tuscany integration has been tested with the Apache Tomcat 5.5.15 release.

== Common Libraries ==
The JAR files containing API classes used by applications must be copied to 
`${catalina.base}/common/lib`
Due to limitations in the current SDO implementation, some Eclipse EMF classes 
it requires must also be copied to that location.

Copy the following files to `${catalina.base}/common/lib`
{{{
sca-api-SNAPSHOT.jar
sdo-api-SNAPSHOT.jar
tuscany-sdo-impl-SNAPSHOT.jar
common-2.2.0-I200602160000.jar
ecore-2.2.0-I200602160000.jar
ecore-change-2.2.0-I200602160000.jar
ecore-xmi-2.2.0-I200602160000.jar
xsd-2.2.0-I200602160000.jar
}}}

== Server Libraries ==
The JAR files containing the Tuscany SCA runtime can be placed in Tomcat's 
implementation directory `${catalina.base}/server/lib`

Copy the following files to `${catalina.base}/server/lib`
{{{
tuscany-common-SNAPSHOT.jar
tuscany-container-java-SNAPSHOT.jar
tuscany-core-SNAPSHOT.jar
tuscany-model-SNAPSHOT.jar
tuscany-tomcat-SNAPSHOT.jar
axis-wsdl4j-1.2.jar
asm-2.2.jar
}}}

If you're planning to use SCA Web Service bindings, copy the following files to 
`${catalina.base}/server/lib`
{{{
tuscany-binding-axis2-SNAPSHOT.jar
axis2-core-0.94.jar
commons-codec-1.3.jar
commons-httpclient-3.0.jar
commons-logging-1.0.4.jar
stax-api-1.0.jar
ws-policy-SNAPSHOT.jar
wstx-asl-2.8.2.jar
}}}

== Server Configuration ==
The Tuscany runtime is integrated by using a special Tomcat Host that has been 
extended to look for SCA configuration information in its child Contexts. If 
such information is found, a Module Component is defined based on that 
configuration and a Valve is inserted into the processing pipeline to set up 
the SCA Module Context for each request.

This is enabled by editing `${catalina.base}/conf/server.xml` to override the 
default Host implementation. Look for the <Host> element for the virtual host 
on which you want to enable SCA and add a 
`className="org.apache.tuscany.tomcat.TuscanyHost"` attribute.
{{{
...
<Host className="org.apache.tuscany.tomcat.TuscanyHost" name="localhost" 
appBase="webapps"
   unpackWARs="true" autoDeploy="true"
   xmlValidation="false" xmlNamespaceAware="false">
...
}}}

= Application Programming =
Application code that wishes to use SCA services can access the module context 
in the normal way using the !CurrentModuleContext API
{{{
ModuleContext ctx = CurrentModuleContext.getContext();
MyService service = (MyService) ctx.locateService("serviceName");
service.doStuff(...);
}}}

Reply via email to