1 / 28

SCA Assembly Model Anish Karmarkar – Oracle Michael Rowley – BEA

SCA Assembly Model Anish Karmarkar – Oracle Michael Rowley – BEA . What is SCA Assembly?. SCA Assembly has been alternately described as: Vendor-, technology- and language-neutral representation of the composition of services into business solutions

vine
Télécharger la présentation

SCA Assembly Model Anish Karmarkar – Oracle Michael Rowley – BEA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SCAAssembly ModelAnish Karmarkar – Oracle Michael Rowley – BEA

  2. What is SCA Assembly? • SCA Assembly has been alternately described as: • Vendor-, technology- and language-neutral representation of the composition of services into business solutions • Unified declarative model for describing and deploying service assemblies • Deployment descriptors on steroids • Component implementation technology for configuring and deploying other component implementation technologies • supports recursion of components to create hierarchical composition

  3. Outline • Bigbank composite example • Java implementation example • Interaction models • Interfaces: local, remote, bidirectional, conversational • ComponentType • Recursive composition • Top-down design: constrainingType • Packaging & deployment • Autowiring • Reuse • Extensibility • Summary

  4. AccountsComposite Example SCA assembly External Banking Reference Payments Component Payment Service OrderProcessing Component Order Processing Service Accounts Ledger Component EventLog Component WarehouseComposite External Warehouse Reference Warehouse Broker Component Warehouse Component Warehouse Service EventLog Reference

  5. Bigbank Composite – multiple components, service, reference & property bigbank.accountcomposite Reference Reference StockQuote StockQuote Service Service AccountService Service Component AccountService AccountData Service Component

  6. <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://example.org" name="bigbank.accountcomposite"> <composite> <service name="AccountService" promote="AccountServiceComponent"> <interface.java interface="services.account.AccountService"/> <binding.ws port="http://www.example.org/AccountService# wsdl.endpoint(AccountService/AccountServiceSOAP)"/> </service> <component name="AccountServiceComponent"> <implementation.java class="services.account.AccountServiceImpl"/> <reference name="StockQuoteService"/> <reference name="AccountDataService" target="AccountDataServiceComponent/AccountDataService"/> <property name="currency">EURO</property> </component> bigbank.accountcomposite StockQuote Reference Reference StockQuote StockQuote Service Service <component name="AccountDataServiceComponent"> <implementation.bpel process=“QName"/> <service name="AccountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </service> </component> AccountService Service Component AccountService AccountData Service Component <reference name=“StockQuoteService" promote="AccountServiceComponent/StockQuoteService"> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.ws port="http://example.org/StockQuoteService# wsdl.endpoint(StockQuoteService/StockQuoteServiceSOAP)"/> </reference>

  7. Java Implementation Example: Service Interface Interface is callable remotely eg. as a Web service package org.example.services.account; @Remotable public interface AccountService { public AccountReport getAccountReport(String customerID); }

  8. Java Implementation Example – Implementation package org.example.services.account; import org.osoa.sca.annotations.*; @Service(AccountService.class) public class AccountServiceImpl implements AccountService { private String currency = "USD"; private AccountDataService accountDataService; private StockQuoteService stockQuoteService; public AccountServiceImpl( @Property("currency")String currency, @Reference("accountDataService")AccountDataService dataService, @Reference("stockQuoteService")StockQuoteService stockService) { this.currency = currency; this.accountDataService = dataService; this.stockQuoteService = stockService; } // end constructor ... } Defines the serviceinterface Defines a property“currency” Defines references “accountDataService” and “stockQuoteService”

  9. SCA Interaction Model • Synchronous & Asynchronous service relationships • Conversational services • stateful service interactions • Asynchronous support • “non-blocking” invocation • asynchronous client to synchronous service • callbacks

  10. Interfaces: Local v. Remotable • Supports multiple components within a single process or separate processes • Local interface • Pass-by-reference • Tightly-coupled • Fine-grained • Remote interface • Pass-by-value (with pass-by-reference override) • Loosely-coupled • Coarse-grained • Java interface • Local: default • Remotable: using @remotable annotation • WSDL portType/interface: always remote • ‘local’ attribute override on the <composite> element

  11. Bidirectional Interfaces (Callbacks) • Useful for asynchronous messaging • Support for callbacks using Java interfaces <interface.java interface="services.invoicing.ComputePrice" callbackInterface="services.invoicing.InvoiceCallback"/> • Support for callbacks using WSDL portTypes/interfaces <interface.wsdl interface="http://example.org/inv# wsdl.interface(ComputePrice)" callbackInterface="http://example.org/inv# wsdl.interface(InvoiceCallback)"/>

  12. Conversational Interfaces • Frees application programmer from conversation/correlation management • Imposes requirements on bindings • Interfaces marked as conversational using SCA Policy intent • Specific operations can be marked as “endsConversation” • WSDL extensions for “conversational” and “endsConversation” <portType name="LoanService" sca:requires="conversational"> <operation name="apply"> <input message="tns:ApplicationInput"/> <output message="tns:ApplicationOutput"/> </operation> <operation name="cancel" sca:endsConversation="true"> </operation> ... </portType>

  13. ComponentType • Describes component implementation type details • Services • References • Properties • Extensibility elements • Can be introspected from the implementation or specified in an XML sidefile • Typically will be introspected from the implementation • Component implementations may use annotations to specify componentType information • eg Java

  14. Java Implementation Example: componentType <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <service name="AccountService"> <interface.java interface="services.account.AccountService"/> </service> <reference name="accountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </reference> <reference name="stockQuoteService"> <interface.java interface="services.stockquote.StockQuoteService"/> </reference> <property name="currency" type="xsd:string"/> </componentType>

  15. Recursive Composition • Composites and Implementations look the same • services • references • properties • composites have associated ComponentType • “Recursive composition” = nesting of composites • composite can be a component implementation in a higher level composite • promotes reuse of assemblies • <implementation.composite../> as component implementation • component can be implemented by “atomic” implementation or by composite

  16. Implementing AccountDataService Using a Composite bigbank.accountcomposite bigbank.accountcomposite Reference Reference StockQuote StockQuote Service Service AccountService AccountService Service Service Component Component AccountService AccountService AccountData AccountData Service Service Component Component implements bigbank.accountdata Service AccountData Logging AccountDataService

  17. AccountDataService ComponentType <componentType> <service name="AccountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </service> </componentType>

  18. bigbank.AccountData Composite <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://example.org" name="bigbank.AccountData"> <service name="AccountDataService" promote="AccountData"> <interface.java interface="services.accountdata.AccountService"/> </service> <component name="AccountDataServiceComponent"> <implementation.bpel process=“..."/> <reference name=“LoggingService" target=“LoggingServiceComponent"/> </component> <component name=“LoggingServiceComponent"> <implementation.spring location=“..."/> </component> <composite>

  19. bigbank.account Composite (recursion) <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://example.org" name="bigbank.accountcomposite"> <service name="AccountService" promote="AccountServiceComponent"> <interface.java interface="services.account.AccountService"/> <binding.ws port="http://..."/> </service> <component name="AccountServiceComponent"> <implementation.java class="services.account.AccountServiceImpl"/> <reference name="StockQuoteService"/> <reference name="AccountDataService" target="AccountDataServiceComponent/AccountDataService"/> <property name="currency">EURO</property> </component> <component name="AccountDataServiceComponent"> <implementation.bpel process=“QName"/> <service name="AccountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </service> </component> <reference name="" promote="AccountServiceComponent/StockQuoteService"> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.ws port="http://..."/> </reference> <composite> <implementation.composite name=“bb:bigBank.AccountData"/>

  20. Top-Down Design: constrainingType • constrainingType • Implementation independent • Specifies the shape -- constraints in terms of services/references/properties • composites, components, componentType and implementations can be constrained using the “constrainingType” attribute • Allows an architect to specify constrainingTypes which can be used by developers as a template • SCA provides runtime validation of artifacts with its constrainingType

  21. constrainingType Example <constrainingType name=“myCT” ... > <service name="MyValueService"> <interface.java interface="services.myvalue.MyValueService"/> </service> <reference name="customerService"> <interface.java interface="services.customer.CustomerService"/> </reference> <property name="currency" type="xsd:string"/> </constrainingType> <component name="MyValueServiceComponent" constrainingType="myns:myCT”> <implementation.bpel process=“..."/> <service name=“MyValueService”> <interface.java interface="services.myvalue.MyValueService"/> <binding.jms .../> </service> <reference name="customerService" target="CustomerService"> <binding.ws ...> </reference> <property name="currency">EURO</property> </component>

  22. Packaging and Deployment: Domains • Composites deployed, configured into SCA Domain • Defines the boundary of visibility for SCA • Typically an area of functionality controlled by single organization/division • E.g.: accounts • Configuration represented by virtual composite • potentially distributed across a network of nodes • containscomponents, services, references, wires • configured using composites • Composites make deployment simpler • individual composites created, deployed independently • may contain only wires or components or externally provided services or references • Abstract services provided for management of the domain

  23. Packaging and Deployment: Contributions • Contributions hold artifacts available for use in the Domain • Package containing artifacts necessary for SCA • SCA defined artifacts • E.g.: composites, constrainingType, etc • Non-SCA defined artifacts • E.g.: WSDL, XML schema, Java classes, object code etc • Packaging must be hierarchical • Metadata included in the “META-INF” directory <contribution xmlns=http://www.osoa.org/xmlns/sca/1.0> <deployable composite="xs:QName"/>* <import namespace="xs:String" location=”xs:AnyURI”?/>* <export namespace="xs:String"/>* </contribution> • Interoperable packaging format: ZIP • Other formats possible: filesystem directory, OSGi bundle, JAR file

  24. SCA Runtime Example Runtime Topology SCA Java Containers SCA JEE Containers SCA CPP Containers … SCA BPEL Container SCA PHP Container Assigned to be hosted by SCA Java container Deployment Mapping Assigned to be hosted by SCA CPP container SCA Domain bigbank.accountmanagement bigbank.stockquote Service Compositions

  25. Autowiring • Allows component references to be wired to component services automatically (without explicit wires) • Matches references to services based on compatible interfaces, bindings, policy intents/sets AccountsComposite External Banking Payment Service Service Payments Component Customer Account Component Product Pricing Component Accounts Ledger Component

  26. Reuse in SCA • Inclusion • Recursive composition • Implementation reuse through configurable components • Reusable services through composite references

  27. Extensibility in SCA • Designed for extensibility • Extensible artifacts: • Implementation types • <implementation.*> • Interface types • <interface.*> • Binding types • <binding.*>

  28. Assembly: Summary • SCA Assembly models systems composed of reusable services • A model for service-based system: • construction • assembly • deployment • Heterogeneity • Multiple languages • Multiple container technologies • Service access methods • Metadata driven

More Related