Tuscany JAVA SCA Runtime

15
Tuscany JAVA SCA Runtime M2

Transcript of Tuscany JAVA SCA Runtime

Page 1: Tuscany JAVA SCA Runtime

Tuscany JAVA SCA Runtime

M2

Page 2: Tuscany JAVA SCA Runtime

Service Component Architecture (SCA)

� Servce oriented component model for describing service assemblies

� Technology independent modeling and composition of service networks

� Unified, language-independent way to expose implementations as services (Java, C++, PHP, Ruby, Javascript, BPEL, XSLT, others)

� Binding model for multiple access methods and infrastructure service

� Is not about implementing API’s

� Service components with service interfaces

Page 3: Tuscany JAVA SCA Runtime

SCA Specs

� SCA Assembly Model V0.96

� SCA Client and Implementation Model for Java (V0.95) � SCA Client & Implementation for BPEL (V0.95) � SCA Client & Implementation for Spring (V0.95) � SCA Client & Implementation for C++ (V0.95)

� SCA Web Service bindings � SCA JMS Binding � SCA EIS/JCA Bindings � SCA Stateless Session Bean Binding

� SCA Policy Framework

Page 4: Tuscany JAVA SCA Runtime

Description Files within an SCA Assembly

� No deployment package specified� ComponentType description could be a side file, annotated code or other

.scdl.componentType

Annotated code

Assembly description

Component Type description

@Service(HelloService.class)public class public class public class public class HelloServiceImpl implements implements implements implements HelloService {public public public public String hello(String message) {

...}

<?xml version="1.0" encoding="ASCII"?><composite xmlns=http://www.osoa.org/xmlns/sca/1.0xmlns:foo=http://foo.com name="AccountServices">

<service name="AccountService"><interface.java interface="foo.AccountService"/><reference>AccountServiceComponent</reference>

</service><property name="complexFoo" type="foo:MyComplexType">

<foo:a>AValue</foo:a><foo:b>InterestingURI</foo:b>

</property><component name="AccountServiceComponent">

<implementation.java class="foo.AccountServiceImpl"/><property name="currency" source="$complexFoo/a"/><reference

name="accountDataService">AccountDataServiceComponent</reference><reference name="stockQuoteService">StockQuoteService</reference>

</component><component name="AccountDataServiceComponent">

<implementation.composite name="AccountDataServiceComposite"/></component><reference name="StockQuoteService">

<interface.java interface=“stock .StockQuoteService"/></reference>

</composite>

<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9"><service name="HelloService"><interfaceinterfaceinterfaceinterface.java interfaceinterfaceinterfaceinterface="services.hello.HelloService"/></service>

...</componentType>

Page 5: Tuscany JAVA SCA Runtime

SCA Assembly

referenceservice

composite

wire wire wire

Binding

Web Service

SCA

JCA

JMS

Interface

Java Interface

WSDL PortType

… ……

component component

Binding

Web Service

SCA

JCA

JMS

Interface

Java Interface

WSDL PortType

property setting

properties

Implementation

Java, PHP

C++, Ruby,

Javascript,

BPEL, XSLT,

Composite,

componentType

Page 6: Tuscany JAVA SCA Runtime

Bootstrap process

host

host-api

Launcher

DeployerBootsptrapper

RuntimeComponent

SCA API

.scdl + .componentType(s) + business logic (services)

SCA Assemblies

System Application

BootBootBootBoot---->>>>DeployDeployDeployDeploy---->>>>

� Bootstrap process is controlled by Host environment

� Runtime is itself an SCA Assebmbly (“System”)

Page 7: Tuscany JAVA SCA Runtime

Deployment

Component

DefinitionComponent

Definition

component

load

buildconnect

component

component

run

deploy

assemblies

repository

composite

SCDL

� Deployment initiates evaluation of an assembly and wiring� Deploy composites or single artifacts (component, service or reference)

Page 8: Tuscany JAVA SCA Runtime

Loading Process

SCA assembly package

Represented byAn Object Model

referenceservice

composite

wire wire wire

component component

property setting

properties

in-memory Configuration Model

Loaders (keyed by QName)

spi.modelspi.modelspi.modelspi.modelSCA assembly model

LoaderRegistry

composite description (.scdl)+ assets

scdl

STAX/Instrospectioncreate

Page 9: Tuscany JAVA SCA Runtime

Building Process

Builders

BuilderRegistry

Set points for dependency injection(properties, references, services, constructor)

Implementation of the components with a set of stubs that need to be

connected to other components

in-memory Configuration Model

Page 10: Tuscany JAVA SCA Runtime

WiringInvocation chains

(one per operation)InboundWire OutboundWire

WireInvocationHandler

Invocation

TargetInvokerassociated with the operation

Payload

interceptors

DataBindingInterceptor

Page 11: Tuscany JAVA SCA Runtime

WebService Binding

ServletContainer

WebappRuntime

JDK

StandaloneRuntime

WebServiceBindingWebServiceBindingLoader

wsdl (url)

Axis2BindingBuilder

Axis2Service

ServiceClient

Axis2ServiceServlet

Axis2TargetInvokerAxiomDataBinding

load

Axis2Reference

buildbuild

<binding.ws…

Page 12: Tuscany JAVA SCA Runtime

Backup Info

Page 13: Tuscany JAVA SCA Runtime

Partial spi. model Class Diagram

Page 14: Tuscany JAVA SCA Runtime

Loaders

� Core� ComponentLoader, ComponentTypeElementLoader, PropertyLoader,

ReferenceLoader, ServiceLoader, InterfaceJavaLoader, DataTypeLoader, ImplementationCompositeLoader, DependencyLoader, CompositeLoader

� System: SystemBindingLoader, SystemImplementationLoader, SystemComponentTypeLoader, SystemCompositeComponentTypeLoader

� Java: InterfaceJavaLoader, JavaComponentTypeLoader, JavaImplementationLoader

� Extensions� Binding: WebServiceBindingLoader, RMIBindingLoader

OSGiBindingLoader, JSONRPCBindingLoader� Implementation: JavaScriptImplementationLoader,

RubyImplementationLoader, SpringImplementationLoader� ComponentType: JavaScriptComponentTypeLoader,

RubyComponentTypeLoader� IDL: InterfaceWSDLLoader

Page 15: Tuscany JAVA SCA Runtime

Some Builders

� Core

� CompositeBuilder, CompositeBindlessBuilder

� System: SystemBindingBuilder, SystemComponentBuilderSystemCompositeBuilder

� Java: JavaComponentBuilder

� Extensions

� Binding: Axis2BindingBuilder, RMIBindingBuilder, ExternalJbiServiceBuilder

� Implementation: JavaScriptComponentBuilder, RubyComponentBuilder, SpringCompositeBuilder