Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
sectioncolumnwidth15%include Welcome to the Apache Tuscany SCA User guide. Here you will find information aimed to help you understand SCA concepts and an example walk through for building your own SCA application. \\ {panel:title=Apache Tuscany SCA User Guide|borderStyle=solid|borderColor=#C3CDA1|titleBGColor=#C3CDA1|bgColor=#ECF4D1} * [*Introduction*|#Intro] * [*Quick Guide to SCA* |#Quick Guide to SCA] * [*Getting Tuscany SCA Java*|#Getting Tuscany SCA Java] * [*SCA Contributions and Composites*|#SCA Contributions and Composites] * [*Tuscany SCA Node*|#Tuscany SCA Node] * [*Hosting Tuscany SCA Nodes*|#Hosting Tuscany SCA Nodes] * [*Tuscany SCA Domain*|#Tuscany SCA Domain] * [*Tuscany SCA Extensions*|#Tuscany SCA Extensions] ** [The Extensible Runtime|#The Extensible Runtime] ** [Available Extensions|#Available Extensions] ** [Using Extensions|#Using Extensions] * [*Tuscany SCA And IDEs*|#Tuscany SCA And IDEs] ** [Using The Samples In An IDE Without Maven|#Using The Samples In An IDE Without Maven] ** [Using The Samples In An IDE If You Have Maven|#Using The Samples In An IDE If You Have Maven] \\ &nbsp; {panel} {note:title:Notification}{center}This page is under construction\- You are welcome to help and complete it{center}{note} h2. {anchor:Intro}{bgcolor:#C3CDA1}Introduction{bgcolor} This user guide will help you become familiar with SCA concepts and walks you through an example that demonstrates how to build an SCA application. It also describes the different environments that Tuscany supports (such as command line clients or web applications) and how to package up applications to run in these environments. *There's nothing to it really!* Building SCA applications is easy. One of the main goals of Tuscany and SCA is to avoid imposing rules and requirements on how people write applications. We want to let people write application code the way they want without being concerned about the environment in which it will be used. After all, writing code to handle plumbing just gets in the way of writing the interesting stuff. So basically, you write the code for interesting bits, and Tuscany provides the environment that lets it run. Therefore, this guide is just an example of how an SCA application can be developed and is not a rule. h2. {anchor:Quick Guide to SCA}{bgcolor:#C3CDA1}Quick Guide to SCA {bgcolor} The [*quick guide to SCA*|Quick Guide To SCA] gives you an overview of SCA concepts and prepares you to work on the example below. You can skip this step if you are already familiar with SCA. For more details on SCA please refer to the specifications at [Open SOA web site|http://www.osoa.org]. h2. {anchor:Getting Tuscany SCA Java}{bgcolor:#C3CDA1}Getting Started with Tuscany SCA Java{bgcolor} There are sever guides that show you how to get started with Apache Tuscany SCA Java. [Getting Started with Tuscany using a Tuscany Distribution from the Command Line|Getting Started with Tuscany ( using the Command Line)] This is a quick getting started guide that shows you how to download the latest release, run the calculator sample and then how to use the calculator sample project as a basis for you own projects [Getting Started with Tuscany using a Tuscany Distribution In Eclipse|Getting Started with Tuscany] This is a quick getting started guide that go trough the steps of building the store scenario using the Tuscany SCA distribution manually installed into Eclipse [Getting Started with Tuscany using the Tuscany Eclipse Plugin|Getting Started with Tuscany (using Tuscany Eclipse Plugin)] This is a quick getting started guide that go trough the steps of building the store scenario using the Tuscany Eclipse plugin. [First Steps - Building your first web services using Tuscany|Build your first Web Services with Tuscany] This is a quick guide that go trough the steps of exposing your pojo component as web services. h2. {anchor:SCA Contributions and Composites}{bgcolor:#C3CDA1}SCA Contributions and Composites{bgcolor} You will have seen from working with the calculator sample ([Getting Started with Tuscany using a Tuscany Distribution from the Command Line|Getting Started with Tuscany ( using the Command Line)]) that an assembly of SCA components is described in a composite file, for example, {code} <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample" xmlns:sample="http://sample" name="Calculator"> <component name="CalculatorServiceComponent"> <implementation.java class="calculator.CalculatorServiceImpl"/> <reference name="addService" target="AddServiceComponent" /> <reference name="subtractService" target="SubtractServiceComponent" /> <reference name="multiplyService" target="MultiplyServiceComponent" /> <reference name="divideService" target="DivideServiceComponent" /> </component> <component name="AddServiceComponent"> <implementation.java class="calculator.AddServiceImpl"/> </component> <component name="SubtractServiceComponent"> <implementation.java class="calculator.SubtractServiceImpl"/> </component> <component name="MultiplyServiceComponent"> <implementation.java class="calculator.MultiplyServiceImpl"/> </component> <component name="DivideServiceComponent"> <implementation.java class="calculator.DivideServiceImpl"/> </component> </composite> {code} The composite describes how SCA components are implemented and how they are assembled by wiring references to targets. This composite file has some dependencies, in this case the Java class and interface files that are used to implement the SCA components that it defines. The collection of composite files and other artifacts that are required to run an SCA application are collected together into one or more SCA contributions. A contribution can be a simple as a directory in a file system or could be packaged in, for example, a Jar file. SCA does not mandate any particular packing scheme. For our calculator sample you can imagine the contribution holding the calculator composite and all of its dependencies. !calculator1.png|align=centre! In fact if you look inside the jar file that the calculator sample produces, you will find the following {code} calculator/AddService.class calculator/AddServiceImpl.class calculator/CalculatorClient.class calculator/CalculatorService.class calculator/CalculatorServiceImpl.class calculator/DivideService.class calculator/DivideServiceImpl.class calculator/MultiplyService.class calculator/MultiplyServiceImpl.class calculator/SubtractService.class calculator/SubtractServiceImpl.class Calculator.composite {code} Which are all the artifacts that are required to run the calculator sample. We just need to add this contribution to the Tuscany SCA java runtime and then call the services that will be enabled. h2. {anchor:Tuscany SCA Node}{bgcolor:#C3CDA1}Tuscany SCA Node{bgcolor} In order to run an SCA application Tuscany SCA Java provides a runtime that is wrapped up in a Node. The runtime itself is made up of many of the modules that are present in the modules directory of the Tuscany SCA Java distribution. As you might expect there are functions that read XML, create an in memory mode model of the SCA assembly, create the components and wire them together ready to process incoming messages. All of these functions are wrapped up in a Node. A node is configured using SCA contributions and will run a single composite. When running standalone the node also defines the scope of component services that references can target by name. SCA defines the term Domain to describe this scope. !calculator2.png|align=centre! A node runs within a single JVM. A JVM can run many Nodes. h2. {anchor:Hosting Tuscany SCA Nodes}{bgcolor:#C3CDA1}Hosting Tuscany SCA Nodes{bgcolor} You can run SCA applications in many different ways but the same underlying runtime is used but packaged in slightly different ways as follows h3. Command Line Most of the samples that are shipped with the Tuscany SCA Java distribution run from the command line. h3. WebApp Some of the samples that are shipped with the Tuscany SCA Java distribution run as web apps h4. Tomcat Running a Tuscany SCA Java enabled webapp in Tomcat is as simple as copying the webapp to the Tomcat webapps directory. h4. Geronimo TBD h4. WebSphere Please see this blog entry to learn how to do this:
Panel
borderColor
border#C3CDA1true
bgColor
#ECF4D1
titleBGColor
#C3CDA1
title
TUSCANY: SCA Java Subproject MenuTUSCANY: SCA Java Subproject Menu
Include Page
TUSCANY: Java SCA Menu NewTUSCANY: Java SCA Menu New
Column
width85%
Wiki Markup
Apache Tuscany SCA User Guide
borderStylesolid
Note
title:Notification
title:Notification
Center
This page is undergoing complete re-write to be more like a user guide than it is today. You are welcome to help review and complete it.

Anchor
Intro
Intro

Background Color
color#C3CDA1
About Tuscany User Guide

It is assumed that by now you have browsed through the introduction to SCA section or are familiar with SCA. This user guide helps you learn more about SCA through Tuscany. It starts with building a simple application and progresses into more advanced features through references to samples that reside in Tuscany.

Before we start, let's emphasise that it is Tuscany's goal to provide an implementaiton that avoids imposing rules and requirements on how you write your applications. In fact the goal is to let you write application code without being concerned about the technology you choose or the environment in which it will be used. You focus on your business logic and Tuscany infrastructure will handle the rest.

Anchor
Create Your First Application
Create Your First Application

Background Color
color#C3CDA1
Create Your First Application

This simple exercise provides you with a hands-on experience for creating an SCA calculator application. Although this is a simple application, it will cover the following items:

  • Creating SCA POJO-based components
  • Composing an application
  • Deploying the application
  • Modifying the application to use a different binding

Give create a calculator application a try.

Anchor
webservices
webservices

Background Color
color#C3CDA1
Create a Webservices component

Learn how to expose your pojo components as webservices. This will cover

  • Creating SCA POJO-based component and exposing it as a webservice

Give Building your first web services using Tuscany a try.

Anchor
distributed application
distributed application

Background Color
color#C3CDA1
Create a Distributed Application

A Tuscany application can be run in a single or multi-node environment. Here we introduce the Tuscany node and SCA domain and explain how the calculator example can be distributed across multiple nodes. We will cover the following:

  • What is a node?
  • What is the SCA domain
  • How to create and application that will run across multiple nodes in a domain

Take a look at Distributed SCA Domain

Anchor
Create an enterprise Application
Create an enterprise Application

Background Color
color#C3CDA1
Create a Store Enterprise Application

Now that you have created a simple calculator application, let's move on to a more interesting application called store. This application is developed in Eclipse enviromment and uses more advanced features that are offered in Tuscany. You will notice that it is as simple to create this application as it was to create the calculator application.

Getting Started with Tuscany using a Tuscany Distribution In Eclipse
This is a quick getting started guide that go trough the steps of building the store scenario using the Tuscany SCA distribution manually installed into Eclipse

Getting Started with Tuscany using the Tuscany Eclipse Plugin

This is a quick getting started guide that go trough the steps of building the store scenario using the Tuscany Eclipse plugin.

Anchor
Host Environments
Host Environments

Background Color
color#C3CDA1
Host Environments

Tusncany applications can be run in a Tuscany standalone environment or in multitude of different host environments. You have seen examples of how to run in standalone environments in the previous sections. Here we cover other platforms.

Tomcat

Running a Tuscany SCA Java enabled webapp in Tomcat is as simple as copying the webapp to the Tomcat webapps directory.

Geronimo

(warning) TODO ... get link from Vamsi

WebSphere

Please see this blog entry to learn how to do this: http://jsdelfino.blogspot.com/2007/10/how-to-use-apache-tuscany-with.html

...

WebLogic

Please see this user's

...

blog

...

to

...

learn

...

how

...

to

...

do

...

this:

...

http://davesowerby.blogspot.com/2008/02/using-tuscany-with-weblogic.html

...

Eclipse

You can develop and run your applications in Eclipse environment.
Getting Started with Tuscany using a Tuscany Distribution In Eclipse
Tuscany also provides a Tuscany Eclipse plug-in to facilitate the development of SCA applications on Tuscany in the Eclipse environment.
Getting Started with Tuscany using the Tuscany Eclipse Plugin

Anchor
using extensions
using extensions

Background Color
color#C3CDA1
Using Extensions

What are extensions? Well, we call these extensions: bindings, implementation types, interface types, policies. Think of SCA Java infrastructure as providing the framework that supports all these pluggable functionality. Bindings provide protocol handling, implementation types provide support for different languages and programming models, interface types allow enable you to define interfaces in different ways for example Java, WSDL and policies enable you to choose which type of policies you want to apply to your application. You can pick and choose what you need based on your requirements and the technologies that you use. For a complete list of available extensions and their documentation please check this link.

Anchor
security
security

Background Color
color#C3CDA1
Running Tuscany with Java2 Security Enabled

Tuscany can be enabled to run with Java2 security on.
Running Tuscany with Java 2 Security Enabled

Anchor
Tuscany dependencies
Tuscany dependencies

Background Color
color#C3CDA1
Do I need all of Tuscany?

Tuscany SCA has a very modular architecture. Think of it as building blocks. You pick what you need for your particular application. In 1.x, there is one binary distribution. you can get to a smaller subset through building the source with the appropriate modules that you need. In 2.x code line, we are aiming to provide smaller distributions. For more information about how you can build a smaller distribution please see this link