Contenu connexe
Similaire à OSGi Remote Services With Sca (20)
OSGi Remote Services With Sca
- 2. IBM Software Group
Agenda
OSGi Remote Services Overview
Service Component Architecture Overview
OSGi + SCA = ?
2 Jan 22, 2010 © 2010 IBM Corporation
- 3. IBM Software Group
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
3 Jan 22, 2010 © 2010 IBM Corporation
- 4. IBM Software Group
Why standardise anything?
Consistency of configuration across implementations
– Remotability of a service
– Security requirements, reliability requirements, etc.
Consistency of behaviour
– Lifecycle, invocation semantics, etc.
4 Jan 22, 2010 © 2010 IBM Corporation
- 5. IBM Software Group
OSGi Standards...thrice the fun
Distributed
Distributed
OSGi RFC
OSGi RFC
Remote
Remote SCA Remote
SCA Remote
Remote
Remote Services
Services Services
Services
Services
Services Admin
Admin Configuration
Configuration
Compendium R4 V4.2
(Chapter 13)
5 Jan 22, 2010 © 2010 IBM Corporation
- 6. IBM Software Group
Local Services
Pass-by-reference
Pass-by-reference
Zero latency
Zero latency
Reliable
Reliable
Service
Service Service
Service
Consumer
Consumer Provider
Provider
Bundle
Bundle Bundle
Bundle
Framework
6 Jan 22, 2010 © 2010 IBM Corporation
- 7. IBM Software Group
Remote Services
Service
Service Service
Service
Consumer
Consumer Network
Network Provider
Provider
Bundle
Bundle Bundle
Bundle
Framework Framework
Pass-by-value
Pass-by-value
Latency
Latency
Unreliable
Unreliable
7 Jan 22, 2010 © 2010 IBM Corporation
- 8. IBM Software Group
OSGi Remote Services
Remote Services
Remote Services Remote Services
Remote Services
Client Configuration
Client Configuration Provider Configuration
Provider Configuration
Service
Service Service
Service
Consumer
Consumer Network
Network Provider
Provider
Bundle
Bundle Bundle
Bundle
Framework Framework
8 Jan 22, 2010 © 2010 IBM Corporation
- 9. IBM Software Group
OSGi Remote Services
Remote Services
Remote Services Remote Services
Remote Services
Client Configuration
Client Configuration Provider Configuration
Provider Configuration
Service
Service Service
Service
Consumer
Consumer Provider
Provider
Bundle
Bundle Bundle
Bundle
Distribution
Distribution Network Distribution
Distribution
Provider Network Provider
Provider Provider
to endpoint endpoint
Framework Framework
9 Jan 22, 2010 © 2010 IBM Corporation
- 10. IBM Software Group
Remote Services Properties
objectClass
objectClass service.exported.interfaces
service.exported.interfaces
service.intents
service.intents service.intents
service.intents
service.exported.intents
service.exported.intents
service.imported.configs
service.imported.configs service.exported.intents.extra
service.exported.intents.extra
service.imported
service.imported service.exported.configs
service.exported.configs
<other service properties>
<other service properties> <other service properties>
<other service properties>
Service
Service Service
Service
Consumer Network
Network Provider
Consumer Provider
Bundle
Bundle Bundle
Bundle
to endpoint endpoint
Framework Framework
10 Jan 22, 2010 © 2010 IBM Corporation
- 11. IBM Software Group
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 remote
service.exported.intents.extra – admin configured for remote
Inspired by SCA intents, examples include
– confidentiality, integrity, atLeastOnce, atMostOnce, SOAP.v1_1, etc.
11 Jan 22, 2010 © 2010 IBM Corporation
- 12. IBM Software Group
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
12 Jan 22, 2010 © 2010 IBM Corporation
- 13. IBM Software Group
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.
13 Jan 22, 2010 © 2010 IBM Corporation
- 14. IBM Software Group
Intents enable separation of concerns
Whatever...
Mr President doesn't really care how his requirements are satisfied.
14 Jan 22, 2010 © 2010 IBM Corporation
- 15. IBM Software Group
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.config
com.acme.config.host = …
com.acme.config.port = ...
15 Jan 22, 2010 © 2010 IBM Corporation
- 16. IBM Software Group
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
16 Jan 22, 2010 © 2010 IBM Corporation
- 17. IBM Software Group
Remote Services Admin: inside the 'black box'
Decomposes the role of Distribution Provider
Endpoint
Listener
Topology
Topology Discovery Network
Manager
Manager Discovery Network
Endpoint
Listener
Remote Remote
Service Service
Admin Admin
Exported Listener
Service
Service
Service Remote
Remote
Provider/
Provider/ Service
Service
Consumer
Consumer Admin
Admin
to endpoint/
endpoint
Imported Distribution Provider
Service
17 Jan 22, 2010 © 2010 IBM Corporation
- 18. IBM Software Group
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
18 Jan 22, 2010 © 2010 IBM Corporation
- 19. IBM Software Group
SCA Remote Services Configuration
service.exported.configs = org.osgi.sca
service.exported.configs = org.osgi.sca
A Remote Services org.osgi.sca.bindings = OrderServiceBindingWS
org.osgi.sca.bindings = OrderServiceBindingWS
Configuration Type re-using
SCA Bindings and Policy
configuration
Service states use of Service
Service
Provider
Provider
org.osgi.sca configuration type Bundle
Bundle
Service identifies binding(s) to
use, by name Configuration
Configuration
Bundle
Bundle
Distribution
Distribution Extends Bindings
Bindings manage through Provider
Provider Policy
endpoint Intents
configuration bundles
Framework
<sca-config ...>
<binding.ws name="OrderServiceBindingWS"
uri="http://localhost:8086/OrderService" />
...
</sca-config>
19 Jan 22, 2010 © 2010 IBM Corporation
- 20. IBM Software Group
SCA Remote Services Configuration Summary
Standardized fully-portable distribution provider
configuration
Based on SCA Bindings and SCA Policy
Configuration for interoperability through interoperable
binding
20 Jan 22, 2010 © 2010 IBM Corporation
- 21. IBM Software Group
Demo time...fingers crossed
service.exported.configs = org.osgi.sca
service.exported.configs = org.osgi.sca
org.osgi.sca.bindings = Calculator
org.osgi.sca.bindings = Calculator
Calculator
Calculator
Service
Service
Interface
Interface
“Graham's
DIY runtime”
Calculator
Calculator
Service
Service
Implementation
Implementation
Calculator
Calculator
Configuration
Configuration
Tuscany
Tuscany Extends Bindings
Distribution
Distribution
Provider Policy
Provider
endpoint Intents
OSGi Framework
<sca-config ...>
<binding.ws name="Calculator"
uri="http://localhost:8086/CalculatorService" />
...
</sca-config>
21 Jan 22, 2010 © 2010 IBM Corporation
- 22. IBM Software Group
Service Component Architecture
That seems to work...but some hereticspeople want to
explore the world outside OSGi...
22 Jan 22, 2010 © 2010 IBM Corporation
- 23. IBM Software Group
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...
23 Jan 22, 2010 © 2010 IBM Corporation
- 24. IBM Software Group
SCA Overview
Service Reference
- Java interface - Java interface
- WSDL PortType - WSDL PortType
Composite A
Component Component
Service A B Reference
Promote Promote
Wire
Binding Implementation Binding
Web Service - Java Web Service
SCA - BPEL SCA
JCA - Composite JCA
JMS … JMS
SLSB SLSB
… …
24 Jan 22, 2010 © 2010 IBM Corporation
- 25. IBM Software Group
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
name="bigbank.accountcomposite" >
<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>
<composite>
25 Jan 22, 2010 © 2010 IBM Corporation
- 26. IBM Software Group
OSGi + SCA = ???
It's all a matter of perspective
OSGi sees a
Distribution Provider
SCA sees an OSGi
Implementation Type
26 Jan 22, 2010 © 2010 IBM Corporation
- 27. IBM Software Group
OSGi-centric View
Business as Usual for the OSGi
Developer
Unaware of enclosing SCA
Component Bundle
Bundle
com.acme.Order
com.acme.Order
– Implementation detail of the 1.0.0
1.0.0
SCA Distribution Provider Bindings
Policy
– Could be generated on-the-fly Intents
(Optionally) Use SCA Remote
OrderComponent
Service Configuration Type to
configure SCA runtime
This is what I demonstrated
27 Jan 22, 2010 © 2010 IBM Corporation
- 28. IBM Software Group
SCA-centric View
OSGi implementation type
(implementation.osgi) identifies the bundle
<composite xmlns...>
<component name="OrderComponent">
Service and reference elements describe
<tuscany:implementation.osgi
the remote services bundleSymbolicName="com.acme.Order"
bundleVersion="1.0.0" />
Support OSGi Remote Services Metadata <service name="OrderService" />
to ensure only 'remotable' services are <reference name="creditReference" />
</component>
distributed ...
</composite>
Can then describe assembly with Java EE,
BPEL, JavaScript, Spring, etc.
Customer Component Warehouse
Component Component
(POJO) Order
Order (BPEL)
Bundle
Bundle
1.0.0
1.0.0
Composite
28 Jan 22, 2010 © 2010 IBM Corporation
- 29. IBM Software Group
Futures
Emergence of OSGi Application Models
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
“Application”
Component
Standardization of SCA/OSGi integration
29 Jan 22, 2010 © 2010 IBM Corporation
- 30. IBM Software Group
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/
30 Jan 22, 2010 © 2010 IBM Corporation