Space: Apache Tuscany Docs 2.x (http://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x) Page: SCA Java Runtime Overview (http://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/SCA+Java+Runtime+Overview)
Edited by Simon Laws: --------------------------------------------------------------------- h1. Software Organization h3. Source Code Locations If you take a Tuscany SCA Java source distribution or look in the Tuscany subversion repository (http://svn.apache.org/repos/asf/tuscany/java/sca/) you'll see the code layed out as follows: {code} BUILDING CHANGES LICENSE NOTICE README RELEASE_NOTES archetypes - Maven archetypes for creating Tuscany project templates distribution - the code that defines and build Tuscany distributions features - Maven projects that collect together Tuscany features itest - project integration tests modules - the source code for the runtime and the SCA extensions pom.xml samples - project samples shades - TBD {code} There is some related source code that's worth mentioning up front. Firstly the project Maven build relies on a set of Maven plugins that have been written specifically for Tuscany. They can also be found in the Tuscany subversion repository (http://svn.apache.org/repos/asf/tuscany/maven-plugins/trunk/) and are as follows: {code} maven-bundle-plugin - Creates Tuscany OSGi bundles based on the Tuscany modules and their dependencies also generates eclipse PDE projects for Tuscany modules maven-eclipse-compiler - Compiles using the Eclipse compiler and performs OSGi validation maven-java2wsdl-plugin - TBD maven-osgi-junit - Runs Junit tests in an OSGi environment maven-tuscany-plugin - TBD maven-wsdl2java-plugin - TBD {code} Secondly there are a set of tests that the OASIS SCA specifications define called otests. These test the Tuscany SCA runtime for compliance with the specifications. The tests themselves are stored in the OASIS subversion system (http://tools.oasis-open.org/version-control/browse/). Tuscany has a set of modules that retrieve these tests automatically and configure the Tuscany environment to run them (http://svn.apache.org/repos/asf/tuscany/otest/) as follows: {code} README build.xml - Ant utility script pom.xml sca-assembly - Generated automatically by svn externals when you check this directory out sca-java-caa - Generated automatically by svn externals when you check this directory out sca-java-ci - Generated automatically by svn externals when you check this directory out sca-policy - Generated automatically by svn externals when you check this directory out tuscany-java-caa-test-runner - Java Common Annotations and APIs test runner tuscany-java-ci-test-runner - Java Component Implementation test runner tuscany-policy-test-runner - Policy test runner tuscany-test-runner - Assembly test runner {code} h3. SCA Java Modules All of the functional code in Tuscany Java SCA can be found under the modules directory. There are a lot of sub-directories here but they basically fall into one of two categories, core function or extensions. We are using the term extension here in the sense that the SCA Assembly specification talks about and extension model You always have to have the core functions but most of the extensions are optional (we say most here because without some of the basic extensions the runtime won't do anything) Finding extension modules is easy. Modules that start with the following words are extensions. {code} binding databinding implementation interface policy {code} As you can see SCA extensions relate to the extensible parts of the SCA composite file. For example, if you want to use <binding.jms/> in you SCA composite files then you need to include the Tuscany modules for this extension in you installation. In this case that would mean the modules binding-jms and binding-jms-runtime. All of the other modules in the modules directory are core modules and are generally required to be present in you Tuscany runtime installation. The use of the word "generally" here sounds a bit vague. This is because the Tuscany runtime itself is based on an extensibility mechanism which means that many parts of the runtime (as well as the SCA extensions) are pluggable. In this way, for example, different hosting environments can be supported. Well talk about runtime extensibility further down this article but for the time being consider all core modules to be mandatory. h1. Runtime Building Blocks As you may have realized the Tuscany SCA Java runtime is just a Java program that, once started listens for incoming messages (via SCA component services) and, sometimes responds with outgoing messages (via SCA component references). !tuscany-runtime-context.png! The runtime then provides the context within which SCA composite applications run. If we crack open the Tuscany Runtime box we see the following structure. !tuscany-runtime-structure.png! We'll take a high level look at these different blocks in turn starting with Core. h1. Tuscany Core The Tuscany core is made up of several modules that provide basic runtime and extensibility support to the extensions that provide the real SCA functions. If you look in the modules directory of a Tuscany distribtuion (2.0-M4 at the time of writing - this list may change in subsequent releases) the modules that make up the Tuscany core are as follows: {code} assembly - The in-memory model of an OASIS SCA composite application (sometimes called an assembly) assembly-xml - The Tuscany processors that translate to and from XML and the in-memory model assembly-xsd - The schema used to validate the contents of various SCA files, e.g. the composite file builder - Process the in-memory model to build a complete SCA application representation common-java - General Java utilities common-xml - General XML utilities contribution - Read and process SCA contributions core - The core Tuscany SCA Java runtime functions core-databinding - The core databinding functions core-spi - The Java interfaces that extension developers use to create and register extensions databinding - Builds on the core databinding functions to provide features common to all databindings??? deployment - Loads the runtime and orchestrates the loading of SCA contributions extensibility - Reads META-INF/services files and manages Tuscany extensibility extensibility-equinox - Manages Tuscany extensibility in an OSGi environment host-http - Base interfaces for providing integration with a servlet container interface-java - Java interface model and instrospection interface-java-jaxws - Process JAX-WS annotations from a Java interface interface-wsdl - WSDL interface model launcher - Command line Tuscany runtime launcher monitor - Collects errors as they occur in the Tuscany runtime node-api - API for accessing an embedded Tuscany node (A node loads/runs contributions) node-impl - The JSE implementation for the node API node-impl-osgi - The OSGi implementation for the node API ???? node-launcher - The JSE based command line launcher for a Tuscany node node-launcher-equinox - The OSGi based command line launcher for a Tuscany node sca-api - The OASIS defined SCA API sca-client-impl - The Tuscany implementation of the OASIS defined SCA client xsd - The in-memory model of an XSD file, along with the processors to read it {code} We have already said that there are a set of extensions that, while in theory they are are optional, are in practice required to do anything useful. These are are follows: {code} binding-sca-runtime - The implementation for the local version of binding.sca binding-sca-axis2-runtime - The implementation for the remote version of binding.sca based on web services binding-ws - The in-memory model for binding.ws binding-ws-axis2 - TBD - should be called runtime binding-ws-axis2-policy - TBD binding-ws-wsdlgen - TBD databinding-axiom - The databinding for Axiom databinding-jaxb - The databinding for JAXB databinding-jaxb-axiom - ??? endpoint-tribes - The distributed endpoint registry based on tribes host-jetty - Allows Jetty to be started automatically to support HTTP based bindings host-webapp - Allows Tuscany to be embedded in a WAR implementation-java - The in-memory model for implementation.java implementation-java-runtime - The runtime artifacts for implementation.java {code} The rest of the modules are optional and can be omitted. In practice the easiest way to get started is to keep all of the modules. By default this is what you get when you install the binding distribution. In the future you are free to remove the extensions you don't use to reduce the size of the installation. The Tuscany project may even make releases in the future that package sets of extensions targeted at particular types of application. h2. Runtime environments, OSGi and JSE The Tuscany runtime will work in the JSE environment and when deployed to an OSGi runtime like Felix or Equinox. Since 1.x we have been through an exercise of refactoring all of the runtime modules in OSGi bundles and providing consistent OSGi manifest files. See (???) for more details on how we OSGi-igfied the Tuscany runtime. h2. Runtime Extensibility h2. Runtime Modularity h1. Tuscany SPI The packages that describe the Tuscany SPI are as follows: {code} {code} h1. SCA Extensions h1. Tuscany API h1. Tuscany Hosting h1. Runtime Features h1. Domain and Nodes h1. Runtime Lifecycle h2. Read h2. Resolve h2. Build h2. Activate h2. Start h2. Stop Change your notification preferences: http://cwiki.apache.org/confluence/users/viewnotifications.action
