Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
SCA Component
Implementation
C++
Java
BPEL
etc
2
SCA Component
• Interface: description of business functions
– Eg: java interface, WSDL 1.1 portType, WSDL interface
• Binding: access mechanisms used by services and
reference
– Eg: WSDL binding, JMS binding, EJB Session bean
binding
• Service: externally accessible software functionality of
an implementation
• Reference: dependency on an external service
• Property: allow for the configuration of an
implementation with externally set data values
– Eg: an implementation that allows the value for
‘currency’ property to be set to any of the world
currencies
3
SCA Composite
Implementation
C++
Java
BPEL
etc
4
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://example.org“ name=“..." >
<component name=“A">
<implementation ... />
<property name=“...">...</property>
<service name=“...">...</service>
<reference name="" target="B"/>
</component>
<component name=“B">
<implementation ... />
<property name=“...">...</property>
<property name=“...">...</property>
<service name=“...">...</service>
<reference name="“ .../>
</component>
<property name="...">...</property>
<property name="...">...</property>
<reference name="..."
promote=“B"/>
</composite>
5
Composition vs technologies
6
Example
7
Example
8
Implementation Types
9
Wiring java implementation with
SCA description
10
Java Common Annotations
• Java Annotations for generating corresponding componentType
• Implementation annotations
– @Service, @Reference, @Property
– @ComponentName,…
• Interface annotations
– @Callback, @Remotable, @Oneway
11
Java Annotation Example
package services.account;
...
public class AccountServiceImpl implements AccountService {
@Property
private String currency = "USD";
@Reference
private AccountDataService accountDataService;
@Reference
private StockQuoteService stockQuoteService;
...
public AccountReport getAccountReport(String customerID) {
...
}
...
}
12
Java implementation
import org.osoa.sca.annotations.Reference;
public class ComponentImpl implements Service1, Service2{
@Reference
private Reference1 r1;
@Reference
private Reference2 r2;
13
SCA Bindings
14
SCA Bindings
• Bindings
– Bindings specify how one component communicates with
another.
– Specific to particular:
• Access Method / Protocol / Transport
• Serialization
• Framework
– Apply to services and references
– A single component may have multiple bindings
• Types
– Web Service Binding
– JMS Binding
– EJB Session Bean Binding
– etc
15
Web Service Binding
• WSDL-based
• Supports WSDL 1.1 and WSDL 2.0
• Two ways to specify a WS binding
– Reference an existing WSDL
binding/service/endpoint/port element
– Specify metadata to synthesize a SOAP-based WSDL
binding
<binding.ws wsdlElement="xs:anyURI"?
wsdli:wsdlLocation="list of xs:anyURI"?>
</binding.ws>
16
Web Service Binding Examples
• Point to an existing WSDL document
<binding.ws
wsdlElement="http://helloworld#wsdl.service(HelloWorldService)" />
• Synthesize WSDL
<component name="HelloWorldServiceComponent">
<implementation.java class="helloworld.HelloWorldImpl" />
<service name="HelloWorldService">
<binding.ws uri="http://localhost:8085/HelloWorldService" />
</service>
</component>
17
binding.ws
• URI
<service name="AccountService" promote="AccountServiceComponent">
<interface.java interface="services.account.AccountService"/>
<binding.ws uri="http://www.example.org/AccountService"/>
</service>
• Service
<service name="AccountService" promote="AccountServiceComponent">
<interface.java interface="services.account.AccountService"/>
<binding.ws service="http://www.example.org/AccountService#
wsdl.endpoint(AccountService)"/>
</service>
• Port
<service name="AccountService" promote="AccountServiceComponent">
<interface.java interface="services.account.AccountService"/>
<binding.ws port="http://www.example.org/AccountService#
wsdl.endpoint(AccountService/AccountServiceSOAP)"/>
</service>
18
binding.ejb
<binding.ejb
homeInterface="NCName"?
ejb-link-name="NCName"?
session-type="stateful or stateless"?
ejb-version="EJB2 or EJB3"?
name="NCName"?
policySets=" sca:listOfQNames"?
requires="sca:listOfQNames"?
uri="anyURI"?
>
<!-- additional elements here -->
</binding.ejb>
<binding.ejb
uri="corbaname:rir:#ejb/JobBankServiceHome“
homeInterface="com.app.jobbank.JobBankServiceHome“
/>
19
SCA & BPEL
20
SCA & WS-BPEL: Services and References
WS-BPEL Process
partnerLink A partnerLink B
(myRole) (partnerRole)
flow
Service receive Reference
A B
wire wire
invoke
reply
property
currency
WS-BPEL Process
sca:property="yes"
variable
currency
flow
...
...
23
Bottom-up Composition
properties
Wrap the components in a
composite and configure external
services/references
24
Top-down Composition
Properties
Composite
Ref
Start with gathering requirements
for the top-level composite
Service
Define the services/references and Ref
properties for the composite
Break down the composite
into individual components
and wires between them
25
Heterogeneous Assembly
PHP
BPEL
Java
Legacy C++
26
Implementation Reuse – By Configuration
Properties
…
References
different currency, tax rate, discount
charts, etc.
Component
27
Deployment Flexibility
WS
Clients SOAP/HTTP Properties
WS Binding
References
Services
ERP
JMS JMS Service
Clients Binding
JCA Binding
28
Overall picture
29
SCA
SCA tools
30
SCA Tools
• Eclipse SOA Tools Project
– Outils Eclipse for SOA – SCA applications
– http://www.eclipse.org/stp/
• SCA containers (application servers)
– Commercial
• IBM WebSphere,
• SAP,
• Oracle Fabric,
• BEA,
• TIBCO
– Open Source
• OW2-Frascati (ow2.org),
• Newton
• Apache Tuscany
31
Tuscany
• Apache Tuscany
– Tuscany SCA Java
– Standalone runtime or deployed on WebSphere, Geronimo,
Tomcat, JBoss platforms
http://tuscany.apache.org
32
Eclipse STP SCA
Composite Designer