osgi remote services with sca

30
IBM Software Group © 2010 IBM Corporation OSGi + SCA = ??? Graham Charters [email protected]

Upload: mfrancis

Post on 03-Jul-2015

1.926 views

Category:

Technology


0 download

DESCRIPTION

Presentation by Graham Charters (IBM) from OSGi Users' Forum UK meeting on 19th January 2010.

TRANSCRIPT

Page 1: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation

OSGi + SCA = ???

Graham Charters

[email protected]

Page 2: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation2 Jan 22, 2010

Agenda

OSGi Remote Services Overview

Service Component Architecture Overview

OSGi + SCA = ?

Page 3: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation3 Jan 22, 2010

OSGi Remote Services History

OSGi R4 V4.1 mute on service remoting

Some projects had demonstrated possiblities

– Apache Tuscany (http://tuscany.apache.org/)

– R-OSGi (http://r-osgi.sourceforge.net/)

– Newton (http://newton.codecauldron.org)

– ...

Distribution seen as a core aspect of “Enterprise OSGi”

– Spec work started in 2008

Page 4: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation4 Jan 22, 2010

Why standardise anything?

Consistency of configuration across implementations

– Remotability of a service

– Security requirements, reliability requirements, etc.

Consistency of behaviour

– Lifecycle, invocation semantics, etc.

Page 5: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation5 Jan 22, 2010

OSGi Standards...thrice the fun

DistributedOSGi RFC

DistributedOSGi RFC

RemoteServices

RemoteServices

RemoteServicesAdmin

RemoteServicesAdmin

SCA RemoteServices

Configuration

SCA RemoteServices

Configuration

Compendium R4 V4.2(Chapter 13)

Page 6: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation6 Jan 22, 2010

Framework

Local Services

Service ProviderBundle

Service ProviderBundle

Service Consumer

Bundle

Service Consumer

Bundle

Pass-by-referenceZero latencyReliable

Pass-by-referenceZero latencyReliable

Page 7: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation7 Jan 22, 2010

Framework Framework

Remote Services

Service ProviderBundle

Service ProviderBundle

Service Consumer

Bundle

Service Consumer

Bundle

Pass-by-valueLatencyUnreliable

Pass-by-valueLatencyUnreliable

NetworkNetwork

Page 8: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation8 Jan 22, 2010

Framework Framework

OSGi Remote Services

Service ProviderBundle

Service ProviderBundle

Service Consumer

Bundle

Service Consumer

Bundle

Remote ServicesProvider Configuration

Remote ServicesProvider Configuration

Remote ServicesClient Configuration

Remote ServicesClient Configuration

NetworkNetwork

Page 9: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation9 Jan 22, 2010

Framework Framework

OSGi Remote Services

Service ProviderBundle

Service ProviderBundle

Service Consumer

Bundle

Service Consumer

Bundle

DistributionProvider

DistributionProviderDistribution

ProviderDistribution

Provider

Remote ServicesProvider Configuration

Remote ServicesProvider Configuration

endpoint

Remote ServicesClient Configuration

Remote ServicesClient Configuration

NetworkNetwork

to endpoint

Page 10: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation10 Jan 22, 2010

Remote Services Properties

Framework Framework

Service ProviderBundle

Service ProviderBundle

Service Consumer

Bundle

Service Consumer

Bundle

service.exported.interfaces

service.intents service.exported.intents service.exported.intents.extra

service.exported.configs

<other service properties>

service.exported.interfaces

service.intents service.exported.intents service.exported.intents.extra

service.exported.configs

<other service properties>

objectClass

service.intents

service.imported.configs

service.imported

<other service properties>

objectClass

service.intents

service.imported.configs

service.imported

<other service properties>

endpoint

NetworkNetwork

to endpoint

Page 11: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation11 Jan 22, 2010

Remote Services Intents

Describe an abstract requirement or capability

– Separation of concerns – statement of requirement/capability independent of implementation

Three properties

service.intent – provided by the service (local and remote)service.exported.intents – statically configured for remoteservice.exported.intents.extra – admin configured for remote

Inspired by SCA intents, examples include

– confidentiality, integrity, atLeastOnce, atMostOnce, SOAP.v1_1, etc.

Page 12: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation12 Jan 22, 2010

Intents enable separation of concerns

There's bad people out there, so I want to

ensure the confidentiality and integrity of my really

secret messages

Mr President expresses his requirements in layman's terms

Page 13: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation13 Jan 22, 2010

Intents enable separation of concerns

I can give you SSL, TripleDES, X.509, S-MIME, double

expresso, ...

The security expert understands these terms and maps them to an appropriate implementation choice.

Page 14: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation14 Jan 22, 2010

Intents enable separation of concerns

Mr President doesn't really care how his requirements are satisfied.

Whatever...

Page 15: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation15 Jan 22, 2010

Remote Service Configuration Types

Identifies a type of Distribution Provider specific configuration

Use reverse domain name scheme to avoid conflict

Property naming convention used for extra config

service.remote.configs = com.acme.configcom.acme.config.host = …com.acme.config.port = ...

Page 16: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation16 Jan 22, 2010

OSGi Remote Service Summary

Standardised basic metadata for distribution

– Remote interfaces

– Default invocation semantics

– Place to hang QoS requirements (intents)

– Place to hang distribution provider configuration

Distribution provider treated like a 'black box'

– No standard way to influence topology

– No standard way to influence publication/discovery

Page 17: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation17 Jan 22, 2010

Distribution Provider

Remote Services Admin: inside the 'black box'

Decomposes the role of Distribution Provider

RemoteServiceAdmin

RemoteServiceAdmin

NetworkNetworkDiscoveryDiscovery

EndpointListener

EndpointListener

RemoteServiceAdmin

RemoteServiceAdmin

Listener

ServiceProvider/

Consumer

ServiceProvider/

Consumer

ExportedService

ImportedService

TopologyManager

TopologyManager

endpointto endpoint/

Page 18: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation18 Jan 22, 2010

Remote Services Admin Summary

Builds on Remote Services to standardise

– Control topology

– Administration of distribution provider

– Integration discovery

However...

– Distribution configuration details left to distribution provider

• Encryption, signing, protocols, reliability

– Full configuration not portable

– No standard way to configure for interoperability

Page 19: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation19 Jan 22, 2010

SCA Remote Services Configuration

A Remote Services Configuration Type re-using SCA Bindings and Policy configuration

Service states use of org.osgi.sca configuration type

Service identifies binding(s) to use, by name

Bindings manage through configuration bundles

Framework

Service ProviderBundle

Service ProviderBundle

service.exported.configs = org.osgi.sca org.osgi.sca.bindings = OrderServiceBindingWS

service.exported.configs = org.osgi.sca org.osgi.sca.bindings = OrderServiceBindingWS

ConfigurationBundle

ConfigurationBundle

DistributionProvider

DistributionProvider

Extends BindingsPolicyIntents

<sca-config ...> <binding.ws name="OrderServiceBindingWS" uri="http://localhost:8086/OrderService" /> ...</sca-config>

endpoint

Page 20: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation20 Jan 22, 2010

SCA Remote Services Configuration Summary

Standardized fully-portable distribution provider configuration

Based on SCA Bindings and SCA Policy

Configuration for interoperability through interoperable binding

Page 21: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation21 Jan 22, 2010

OSGi Framework

Demo time...fingers crossed

CalculatorService

Implementation

CalculatorService

Implementation

service.exported.configs = org.osgi.sca org.osgi.sca.bindings = Calculator

service.exported.configs = org.osgi.sca org.osgi.sca.bindings = Calculator

CalculatorConfigurationCalculator

Configuration

TuscanyDistribution

Provider

TuscanyDistribution

Provider

Extends BindingsPolicyIntents

<sca-config ...> <binding.ws name="Calculator" uri="http://localhost:8086/CalculatorService" /> ...</sca-config>

endpoint

CalculatorService

Interface

CalculatorService

Interface

“Graham'sDIY runtime”

Page 22: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation22 Jan 22, 2010

Service Component Architecture

That seems to work...but some hereticspeople want to explore the world outside OSGi...

Page 23: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation23 Jan 22, 2010

What is the Service Component Architecture (SCA)?

Heterogeneous component assembly

Synchronous, asynchronous, event processing

Pluggable communications protocols

Think Blueprint Service or Spring Framework only with bigger components implemented using different stuff and able to talk to other different stuff...

Page 24: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation24 Jan 22, 2010

SCA Overview

Composite A

ComponentAService

BindingWeb ServiceSCAJCAJMSSLSB…

BindingWeb ServiceSCAJCAJMSSLSB…

ComponentB

Service- Java interface- WSDL PortType

Reference- Java interface- WSDL PortType

WirePromotePromote

Reference

Implementation - Java - BPEL - Composite …

Page 25: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation25 Jan 22, 2010

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 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>

<component name="AccountDataServiceComponent"> <implementation.bpel process=“QName"/> <service name="AccountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </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>

Page 26: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation26 Jan 22, 2010

OSGi + SCA = ???

It's all a matter of perspective

OSGi sees a Distribution Provider

SCA sees an OSGiImplementation Type

Page 27: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation27 Jan 22, 2010

OSGi-centric View

Business as Usual for the OSGi Developer

Unaware of enclosing SCA Component

– Implementation detail of the SCA Distribution Provider

– Could be generated on-the-fly

(Optionally) Use SCA Remote Service Configuration Type to configure SCA runtime

This is what I demonstrated

Bundle

com.acme.Order

1.0.0

Bundle

com.acme.Order

1.0.0

OrderComponent

BindingsPolicyIntents

Page 28: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation28 Jan 22, 2010

SCA-centric View

OSGi implementation type (implementation.osgi) identifies the bundle

Service and reference elements describe the remote services

Support OSGi Remote Services Metadata to ensure only 'remotable' services are distributed

Can then describe assembly with Java EE, BPEL, JavaScript, Spring, etc.

<composite xmlns...> <component name="OrderComponent"> <tuscany:implementation.osgi bundleSymbolicName="com.acme.Order" bundleVersion="1.0.0" /> <service name="OrderService" /> <reference name="creditReference" /> </component> ...</composite>

<composite xmlns...> <component name="OrderComponent"> <tuscany:implementation.osgi bundleSymbolicName="com.acme.Order" bundleVersion="1.0.0" /> <service name="OrderService" /> <reference name="creditReference" /> </component></composite>

Composite

Component WarehouseComponent(BPEL)

CustomerComponent

(POJO) OrderBundle

1.0.0

OrderBundle

1.0.0

Page 29: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation29 Jan 22, 2010

Futures

Emergence of OSGi Application Models

Standardization of SCA/OSGi integration

BundleBundle

BundleBundle

BundleBundle

Component

“Application”

Page 30: OSGi Remote Services With Sca

IBM Software Group

© 2010 IBM Corporation30 Jan 22, 2010

Summary

OSGi R4 V4.2 standardizes distribution of OSGi services

– OSGi metadata leverages SCA

SCA runtime can fulfill role of OSGi Distribution Provider (OSGi unaware of SCA)

OSGi bundles can participate in SCA applications (simple component assembly model) – integration with other component types, exploit SCA policy and bindings

Enterprise R4 V4.2 Draft Specification

– http://www.osgi.org/download/osgi-4.2-enterprise-early-draft4.pdf

Apache Tuscany

– http://tuscany.apache.org/documentation-2x/