THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Wiki Markup |
---|
Welcome to the Apache Tuscany SCA User guide. Here you will find information aimed to help you develop SCA components and applications using Tuscany's Java SCA implementation.
This is a work in progress, so please contribute and comment so we can make this valuable to you {section}{column:width=50%}{column}
\\
{panel:title=Apache Tuscany SCA User Guide|borderStyle=solid|borderColor=#6699ff|titleBGColor=#D5EFFF|bgColor=#ffffff}
Getting Started
# [Introduction|#Intro]
# [Why SCA?|#Why SCA?]
# [Downloading Java SCA|#Downloading Java SCA]
Example Application
* [Example overview|#Example overview]
* [#Running the Calculator Sample]
* [Running additional samples|Running the samples] (this was already here... may need to move out)
Using Tuscany SCA
* [#Building your own Calculator Application]
* [Building an Application|Building an Application] (this was already here... may need to move out)
* Packaging a standalone Tuscany application
* Running a standalone Tuscany application
* Adding extensions to the standalone environment
* [#Building a Tuscany Web Application]
* Implementing SDO
* Implementing Web Services
* Using Extensions
\\
{panel}{section}
h3. {anchor:Intro}{color:#0099cc}Introduction{color}
Service Component Architecture (SCA) defines technologies for creating services and assembling them into higher-order service networks. SCA provides a language-independent way to compose and deploy service networks. SCA also defines language-specific client programming models for service authoring including Java, Spring, C++, and PHP. This user guide is for Java SCA implementation in Tuscany.
This user guide will help you build a simple application called calculator sample and extend it to more complicated use the Calculator Sample to demonstrate the concepts in SCA and helps you build a simple application using Tuscany Java SCA.
[NOTE: We should focus the user guide on end users. They should not need to download source code]
h3. {anchor:Why SCA? }{color:#0099cc}Why SCA? {color}
Service Oriented Architecture (SOA) is an architectural approach driven by the need to overcome the challenges of tightly coupled and department-specific applications. SOA promises benefits such as improved business agility, improved flexibility, cost reduction, and the easy sharing of information in heterogeneous and distributed environments.
Service Component Architecture (SCA) addresses the complexity of developing an SOA solution through its simple model for creating service-oriented applications for the whole enterprise - from the client to the back-end in a distributed or simple environment.
SCA programming model frees developers from polluting business logic with protocol handling and instead enables them to focus on the business logic through clear component interfaces and binding extensions.
h3. {anchor:Downloading Java SCA } {color:#0099cc}DownLoading SCA {color}
Point to download page. (http://incubator.apache.org/tuscany/sca_downloads.html)
Decide which release this calculator sample will be tested with and guide user to download that release.
h3. {anchor:Example Overview} {color:#0099cc}Example Overview {color}
Paste a picture of calculator application here and explain what we are trying to achieve. cut/paste from Mario's slides.
!java_imp.jpg!
h3. {anchor:Running the Calculator Sample}{color:#0099cc}Running the Calculator Sample{color}
These are preliminary steps...details such as from where to download are forthcoming
# Download the sample file.
# Unzip it to a local folder such as C:\Temp
# In Eclipse, select File \-> Import \-> General \-> Existing Projects into Workspace
# Click Next.
# Select the Select root directory option and click the "Browse" button to point to C:\Temp.
# Select CalcultorSample directory and click Finish. The project is created.
# Expand the CalcultorSample. Expand "src/main/java/calculator", right-click CalculatorClient.java and select Run as ... \--> Java Application. You will see the following output in the console view:
3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
h3. {anchor:Building your own Calculator Application}{color:#0099cc}Building your own Calculator Application{color}
Topics to include?
Creating Java SCA Components
Creating the implementation for the Java SCA components
Creating the composite file
Creatomg a client to invoke the service
Packaging a Standalone Tuscany Application?
Building a Tuscany Web Application?
h4. {color:#0099cc}Components{color}
Compents are the building blocks for creating SOA Applications. They contain the information that defines the program logic or implementation (component implementation), how the component interacts with other components (component type) and defines how it fits in with the other parts of the soluion (composition/assembly).
* A service header file that defines the operations that can be invoked on the component
* An implementation header file that defines the implementation and extends the service header file
* A C+\+ implementation of the service that implements the operations defined in the service header file
* Proxy and wrapper header and implementation files generated by the Tuscany C+\+ SCAGEN tool
* A service definition in a .componentType file
* An SCDL component definition within an SCDL composite file. Usually this composite file will contain multiple components configured and assembled together.
h4. {color:#0099cc}Service Component Descritpion Language (SCDL){color}
h4. {color:#0099cc}Create a client to invoke the service.{color}
# Create a file and name it CalculatorClient.java
Your component, composite and subsystem are now ready to be invoked. Create a client that will call the service. E.g. the Calculator client (in the CalculatorClient.cpp file) contains code similar to the following:
{code}
package calculator;
import org.apache.tuscany.api.SCAContainer;
import org.osoa.sca.CompositeContext;
import org.osoa.sca.CurrentCompositeContext;
/**
* This client program shows how to create an SCA runtime, start it,
* locate the Calculator service and invoke it.
**/
public class CalculatorClient {
public static void main(String[] args) throws Exception {
SCAContainer.start("Calculator.composite");
CompositeContext context = CurrentCompositeContext.getContext();
CalculatorService calculatorService =
context.locateService(CalculatorService.class, "CalculatorServiceComponent");
// Calculate
System.out.println("3 + 2=" + calculatorService.add(3, 2));
System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
System.out.println("3 / 2=" + calculatorService.divide(3, 2));
SCAContainer.stop();
}
}
{code}
h3. {anchor:Building a Tuscany Web Application}{color:#0099cc}Building a Tuscany Web Application{color}
You can run Tuscany inside of a Web application running in any standard Web container such as Apache Tomcat. Once configured, the application is portable across container implementations.
{HTMLcomment:hidden}{children:sort=creation}{HTMLcomment} |