18
Enterprise Service Assembly with Apache Tuscany SCA Raymond Feng, Luciano Resende, Simon Laws IBM PMC members of Apache Tuscany Project

Enterprise Service Assembly with SCA using Apache Tuscany

Embed Size (px)

DESCRIPTION

This is the presentation we gave at JavaOne 2009.

Citation preview

Page 1: Enterprise Service Assembly with SCA using Apache Tuscany

Enterprise Service Assembly with Apache Tuscany SCARaymond Feng, Luciano Resende, Simon Laws IBMPMC members of Apache Tuscany Project

Page 2: Enterprise Service Assembly with SCA using Apache Tuscany

2

Agenda

> Apache Tuscany> SCA Benefits> SCA Tours - Online Travel Sample Scenario

Demo Features

Building components with Java, Spring, JEE Wiring components with Web services, JMS, HTTP Web2.0 in the service assembly Your app goes mobile with Android Deploying applications standalone, in OSGi, in JEE

Page 3: Enterprise Service Assembly with SCA using Apache Tuscany

Apache Tuscany

> Apache Tuscany provides a component based programming model which simplifies development, assembly and deployment and management of composite applications in SOA.

> Apache Tuscany implements SCA standards defined by the OASIS OpenCSA and also provides extensions based on real user feedback.

3

Page 4: Enterprise Service Assembly with SCA using Apache Tuscany

What’s new with Apache Tuscany

> 1.x Code Stream OSOA Based SCA Specification Stable code base SCA Java 1.5 Released 05/31/2009

> 2.x Code Stream OASIS OpenCSA Specification OSGi enabled runtime SCA Java 2.0 M2 Released on 04/15/2009

M3 Released being prepared

4

Page 5: Enterprise Service Assembly with SCA using Apache Tuscany

The power of Tuscany/SCA

> Quick prototype for PoC to convince your boss in hours Mock up new functions (POJOs)

> Reuse existing assets (Java classes, BPEL, Spring, JEE, OSGi)

> Talk to external services transparently (WS, RMI, CORBA, EJB, JMS, …)

> Expose services to other clients transparently (WS, JSONRPC, FEED, RMI, CORBA …)

> Built-in interaction patterns: Req/Res, Oneway, Callback

> Run and debug directly within the IDE

5

Page 6: Enterprise Service Assembly with SCA using Apache Tuscany

6

SCA Tours Online Travel Sample Scenario

http://svn.apache.org/repos/asf/tuscany/sandbox/travelsample

Page 7: Enterprise Service Assembly with SCA using Apache Tuscany

SCA Tours - Travel Booking (Page #1)

TuscanySCAToursUI

TravelCatalog

TripBooking

HotelPartner

FlightPartner

CarPartner

CurrencyConverter

TripPartner

Java

Java

Java

Java

W idget

fullapp-ui (8080) fullapp-frontend (8084) fullapp-packagedtrip (8085)

fullapp-bespoketrip (8086)

fullapp-currency (8083)

EJB

Java

Java

> ls - ls a

SCATours

Java

1 2 34 5 67 8 9

7

Page 8: Enterprise Service Assembly with SCA using Apache Tuscany

SCA Tours - Travel Booking (Page #2)

ShoppingCart Paym entP rocessCreditCard

Em ailGateway

Spring

Script

Java

credicard (8082)fullapp-shoppingcart (8087)

CreditCardUI

Servlet

Java

CartS tore

Java

paym ent (8081)

> ls - ls a

paym entweb

8

Page 9: Enterprise Service Assembly with SCA using Apache Tuscany

9

SCA Tours Online Travel Sample Scenario

DEMO

http://svn.apache.org/repos/asf/tuscany/sandbox/travelsample

Page 10: Enterprise Service Assembly with SCA using Apache Tuscany

Web 2.0 Client Application

10

Embedded TomcatEmbedded Tomcat

implementation.widgetImplementation.java

SCA Tours

Implementation.java

TravelCatalog

Implementation.java

TripBooking

Implementation.java

ShoppingCart

Page 11: Enterprise Service Assembly with SCA using Apache Tuscany

SCA Composite for Tuscany Widget

11

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://scatours" xmlns:scatours="http://scatours" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:pp="http://www.example.org/PaymentProcess" name="ui"> <component name="scatours"> <tuscany:implementation.widget location="scatours.html"/> <service name="Widget"> <tuscany:binding.http uri="/scatours"/> </service> <reference name="scaToursCatalog" target="SCAToursComponent/SCAToursSearch"> <tuscany:binding.jsonrpc/> </reference> <reference name="scaToursBooking" target="SCAToursComponent/SCAToursBooking"> <tuscany:binding.jsonrpc/> </reference> <reference name="scaToursCart" target="SCAToursComponent/SCAToursCart"> <tuscany:binding.jsonrpc/> </reference> </component> </composite>

Page 12: Enterprise Service Assembly with SCA using Apache Tuscany

Mobile Client Application with Android

12

Implementation.java

SCA Tours

Implementation.java

TravelCatalog

Implementation.java

TripBooking

Implementation.java

ShoppingCart

Page 13: Enterprise Service Assembly with SCA using Apache Tuscany

13

Credit Card Payment Scenario

CurrencyConverter

Credit CardPayment

binding.rmibinding.ws

implementation.osgi implementation.osgi

creditcard.jsp

implementation.web

TomcatTomcat

EquinoxEquinoxWeb ServiceClient EquinoxEquinox

RFC 119: Distributed OSGi

Page 14: Enterprise Service Assembly with SCA using Apache Tuscany

14

SCA composite for the Web component<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://creditcard" name="CreditCardPaymentWeb"> <component name="CreditCardPaymentWeb"> <implementation.web web-uri="" /> <reference name="service"> <interface.java

interface="scatours.payment.creditcard.CreditCardPayment"/> <binding.ws uri="http://localhost:8082/CreditCardPayment" /> </reference> </component></composite>

> JSP<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca"%>

<sca:reference name="service"type="scatours.payment.creditcard.CreditCardPayment" />

Page 15: Enterprise Service Assembly with SCA using Apache Tuscany

15

Distributed OSGi with Tuscany/SCA

RMIRMI

CreditCard

PaymentWeb

ServiceWeb

Service

SCA proxiesSCA proxies

Local ServiceLocal Service

Local OSGi ServiceImplementation

OSGi Service Registry

Currency

Converter

SCA Service

SCA References

Page 16: Enterprise Service Assembly with SCA using Apache Tuscany

16

OSGi services in the SCA domain

CurrencyConverter

Credit CardPayment

binding.rmi

binding.ws

Currency Converter Bundle

Currency

Converter

Credit Card PaymentBundle

CreditCard

Payment

SCA DomainNode #1 Node #2

implementation.osgi implementation.osgi

Page 17: Enterprise Service Assembly with SCA using Apache Tuscany

17

SCA composite for the OSGi bundle<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://creditcard" name="CreditCardPaymentComposite">

<component name="CreditCardPaymentComponent"> <tuscany:implementation.osgi

bundleSymbolicName="scatours.creditcard.payment" bundleVersion="1.0.0" /> <service name="CreditCardPayment"> <binding.ws uri="http://localhost:8082/CreditCardPayment"/> </service> <reference name="currencyConverter"> <tuscany:binding.rmi uri="rmi://localhost:8085/CurrencyConverter"/> </reference> </component>

</composite>

Page 18: Enterprise Service Assembly with SCA using Apache Tuscany

18

Raymond Feng ([email protected])Luciano Resende ([email protected])

http://tuscany.apache.org