Download - Eclipse Con2010 Composites
![Page 1: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/1.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
EclipseCon 2010
Isolating Applications in a Collaborative OSGi World
Composite Bundles
Thomas Watson
![Page 2: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/2.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Warning!
Not for the faint of heart!Lots of details.
No fancy slides.
(What would you expect from a framework implementer?)
![Page 3: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/3.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
OSGi R4.2 Review
● New Enterprise Specifications– Remote Services
– Blueprint
● And more on the way ...– Remote Services Admin
– JTA, JMX, JDBC, JNDI, JPA
– Web Applications
– etc.
![Page 4: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/4.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Forget the High-Level Stuff!
● R4.2 Core framework changes– Service registry hooks
– Security enhancements● Ordered conditions● Fine-grained service and package permissions based on
identity of the provider
– Bundle tracker
– Standard launching and embedding
– Composite bundles (provisional spec.)
![Page 5: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/5.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
What can we expect from R4.3 Core?
● Still early in the process● Early access to draft RFCs
● OSGi API update (RFC 151)– Use of generics and adaptor patterns
● Composite Bundles (RFC 138)– Much has changed since the R4.2 provisional spec.
● Generic capabilities and requirements (RFC 154)
![Page 6: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/6.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
What can we expect from R4.3 Core?
● Still early in the process● Early access to draft RFCs
● OSGi API update (RFC 151)– Use of generics and adaptor patterns
● Composite Bundles (RFC 138)– Much has changed since the R4.2 provisional spec.
● Generic capabilities and requirements (RFC 154)
![Page 7: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/7.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Launching & Embedding
![Page 8: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/8.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Implementations
● Bundles are portable● What about the framework?
– Launching and configuring
– Controlling its life cycle
– Externally interacting with bundles, services, and state
![Page 9: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/9.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Launching & Embedding
● Seems like a slam dunk● What does it give us?
– A standard way to create framework instances
– A standard API for controlling and interacting with framework instances
● What does this help?
![Page 10: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/10.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Launching & Embedding
● Seems like a slam dunk● What does it give us?
– A standard way to create framework instances
– A standard API for controlling and interacting with framework instances
● What does this help?– Portable scripts and launchers
![Page 11: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/11.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Interfaces
public interface FrameworkFactory { Framework newFramework(Map config);}
![Page 12: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/12.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Interfaces
public interface FrameworkFactory { Framework newFramework(Map config);}
public interface Framework extends Bundle { void init() throws BundleException; FrameworkEvent waitForStop(long timeout) throws InterruptedException;}
![Page 13: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/13.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Standard Configuration Properties
● org.osgi.framework.bootdelegation
● org.osgi.framework.system.packages
● org.osgi.framework.system.packages.extra
● org.osgi.framework.startlevel.beginning
● org.osgi.framework.storage
● org.osgi.framework.storage.clean
● And others...
![Page 14: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/14.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Out Of Scope
● Multiple framework instances– e.g., no support for sharing/collaboration among
instances or multiplexing of VM singletons
– May or may not work, but implementation dependent
![Page 15: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/15.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Multiple Instances
● Pose interesting challenges● Promise potentially interesting capabilities● This use case uncovers potential framework
issues
![Page 16: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/16.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Composite Bundles
![Page 17: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/17.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
● Applications are either all bundles collaborating or an individual bundle● All global or completely local
● No application/subsystem concept● Isolation/protection (bundles, services, packages)● Visibility (bundles, services, packages)● Grouping (lifecycle)
![Page 18: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/18.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
FrameworkWhere is theapplication?
![Page 19: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/19.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
Assume thesebelong to anapplication
A1
A3
A2
![Page 20: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/20.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
What if they are
subsystems?
A1
A3
A2
![Page 21: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/21.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
Maybe they want private
packages
A1
A3
A2
![Page 22: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/22.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
FrameworkAnd private
services
A1
A3
A2
![Page 23: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/23.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
Need subsystem
encapsulation
![Page 24: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/24.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
Private detailsare hidden
![Page 25: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/25.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
Public packages
are exposed
![Page 26: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/26.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
External packages
are imported
![Page 27: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/27.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
Public servicesare exposed
![Page 28: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/28.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework Limitations
Framework
A1
A3
A2
This blob is acomposite
bundle
![Page 29: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/29.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
![Page 30: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/30.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Composites are composed of bundles with resolved states
![Page 31: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/31.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
C
Composite Bundle
exportorg.foo.b
exportorg.foo.c
A
B
Importing and Exporting Packages
Export
![Page 32: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/32.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
C
Composite Bundle
exportorg.foo.b
exportorg.foo.c
importorg.foo.b
A
importorg.foo.c
B
Importing and Exporting Packages
Import
![Page 33: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/33.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
B
C
A
importorg.foo.b
exportorg.foo.b
importorg.foo.c
exportorg.foo.c
Composite Bundle
Importing and Exporting Packages
Resolve
![Page 34: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/34.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Composites are composed of bundles that publish and bind to
services
![Page 35: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/35.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Composite Bundle
org.foo.b.BService
Publish and Consume Services
Publish
A
C
B
org.foo.c.CService
![Page 36: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/36.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Composite Bundle
Publish and Consume Services
Bind
org.foo.c.CService
org.foo.b.BServiceA
B
C
![Page 37: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/37.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
This looks very similar to a Framework!
![Page 38: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/38.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Can this blob be anested
framework?
![Page 39: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/39.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
A1
A3
A2
How are imports, exports
and serviceshandled?
Framework
Nested Framework
![Page 40: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/40.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Defining a Sharing Policy
![Page 41: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/41.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
A1
A3
A2
Framework
Bundle
To the outside this looks like a normal bundle
Bundle
C
![Page 42: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/42.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
A1
A3
A2
A representation is needed inside for the
exports, imports and services
Framework
C
Nested Framework
![Page 43: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/43.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
A surrogate bundle canprovide this representation
Framework
Composite
A1
A3
A2
Sur
roga
te B
undl
eC
![Page 44: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/44.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
C
The surrogate imports packages exported
by the composite
Sur
roga
te B
undl
e
![Page 45: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/45.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
The surrogate exports packages imported
by the composite
![Page 46: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/46.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
The surrogate consumes services published outside
by the composite
![Page 47: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/47.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
The surrogate registers services consumed by the composite from
the outside
![Page 48: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/48.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
● Issues with modeling composites as real bundles with nested frameworks
![Page 49: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/49.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
● Issues with modeling composites as real bundles with nested frameworks● Sharing everything through a surrogate creates
lifecycle issues
![Page 50: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/50.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
What happens if the composite is
stopped – the composite
framework is shutdown
![Page 51: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/51.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
What happens if the composite is
stopped – the composite
framework is shutdown
![Page 52: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/52.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
But C is still resolved and
expecting to be able to load
classes from the exported package
![Page 53: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/53.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
● Issues with modeling composites as real bundles with nested frameworks● Sharing everything through a surrogate creates
lifecycle issues
![Page 54: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/54.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
● Issues with modeling composites as real bundles with nested frameworks● Sharing everything through a surrogate creates
lifecycle issues● Consumers and Providers loose their identity to the
composite and surrogate– No support for Require-Bundle– ServiceFactory support is limited– Introspecting system dependencies is combersome.
![Page 55: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/55.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
Composite and Surrogate must proxy all shared
resources
![Page 56: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/56.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
Difficulties with proxying service
factories. No way to guarantee
unique locations or bundle IDs
![Page 57: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/57.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
A1
A3
A2
Composite
Sur
roga
te B
undl
eC
Exports loose the identity of their
exporting symbolic name. Require-
Bundle is not possible
![Page 58: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/58.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Transparent Sharing Policy
![Page 59: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/59.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Virtualizing Framework Isolation
● Model isolation in a single framework instance
![Page 60: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/60.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Virtualizing Framework Isolation
● Model isolation in a single framework instance● Each composite has a virtual framework that hides
outside bundles, services, and packages.
![Page 61: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/61.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Virtualizing Framework Isolation
● Model isolation in a single framework instance● Each composite has a virtual framework that hides
outside bundles, services, and packages.● A sharing policy can be declared
– What is visible to the inside from the outside (imported)– What is visible to the outside from the inside (exported)
![Page 62: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/62.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
A Sharing Policy controls the
visibility of shared resources
Framework
Composite
A1
A3
A2
C
![Page 63: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/63.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
Composite
A1
A3
A2
C
What is visible from the point of view of a bundle in a composite
![Page 64: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/64.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Implementing Composites
Framework
Composite
A1
A3
A2
C
What is visible from the point of view of a bundle
in the parent
![Page 65: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/65.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Virtualizing Framework Isolation
● Model isolation in a single framework instance● Each composite has a virtual framework that hides
outside bundles, services, and packages.● A sharing policy can be declared
– What is visible to the inside from the outside (imported)– What is visible to the outside from the inside (exported)
![Page 66: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/66.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Virtualizing Framework Isolation
● Model isolation in a single framework instance● Each composite has a virtual framework that hides
outside bundles, services, and packages.● A sharing policy can be declared
– What is visible to the inside from the outside (imported)– What is visible to the outside from the inside (exported)
● Enforce rules to ensure unique bundle identification● All bundle locations and bundle IDs must be unique● Important for supporting shared service factories
![Page 67: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/67.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Installing a Composite
Configure?
![Page 68: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/68.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Installing a Composite
Configure?
Create?
![Page 69: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/69.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Installing a Composite
Configure?
Create?Reference?
![Page 70: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/70.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
![Page 71: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/71.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
Framework launching configuration
![Page 72: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/72.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
Specify the package export policy
![Page 73: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/73.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
Specify the package import policy
![Page 74: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/74.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
Specify the service import policy
![Page 75: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/75.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Configure
String location = “myComposite; composite=true”;Map config = HashMap();config.put(“...startlevel.beginning”, “25”);
Map manifest = HashMap();manifest.put(“Bundle-SymbolicName”, location);manifest.put(“Composite-PackageExportPolicy”, “b”);manifest.put(“Composite-PackageImportPolicy”, “c”);manifest.put(“Composite-ServiceImportPolicy”, “(objectClass=c.CService)”);manifest.put(“Composite-ServiceExportPolicy”, “(objectClass=b.BService)”);...
Specify service filters to publish
![Page 76: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/76.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Reference?
String location = “myComposite”;Map config = HashMap();Map manifest = HashMap();...
Installing a Composite
Create?
![Page 77: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/77.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Reference? CompositeAdmin. installCompositeBundle( location, manifest, config);
Installing a Composite
String location = “myComposite”;Map config = HashMap();Map manifest = HashMap();...
Obtained from the service registry.
![Page 78: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/78.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
CompositeBundle comp
CompositeBundleextends Bundle
String location = “myComposite”;Map config = HashMap();Map manifest = HashMap();...
Installing a Composite
CompositeAdmin. installCompositeBundle( location, manifest, config);
![Page 79: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/79.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework
Empty Installed Composite
Sharing Policy
Composite Bundle: myComposite
![Page 80: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/80.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Access?
![Page 81: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/81.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Install?Access?
![Page 82: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/82.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Install?
Start?
Access?
![Page 83: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/83.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Install?
Start?
BundleContext ctxt = comp.getSystemBundleContext();...
![Page 84: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/84.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Start?
Bundle a = ctxt.installBundle( “file:a.jar”);Bundle b = ctxt.installBundle( “file:b.jar”);...
BundleContext ctxt = comp.getSystemBundleContext();...
![Page 85: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/85.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Managing a Composite
Bundle a = ctxt.installBundle( “file:a.jar”);Bundle b = ctxt.installBundle( “file:b.jar”);...
a.start();b.start();comp.start();...
BundleContext ctxt = comp.getSystemBundleContext();...
![Page 86: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/86.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework
Resolved Composite
B
A
C
Composite Bundle: myComposite
Sharing Policy
exportb
exportc
Importb
Importc
![Page 87: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/87.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Framework
Active Composite
A
Composite Bundle: myComposite
Sharing Policy
c.CService
b.BService
C
B
![Page 88: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/88.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Demo
![Page 89: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/89.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Isolating SWT and e4 applications
Root Framework
SWT
AppConsoleWeb UI
e4PhotoDemo
e4Contacts
Demo
Each Composite contains their own stack of bundles
which are isolated from each other
![Page 90: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/90.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Isolating SWT and e4 applications
Root Framework
SWT
AppConsoleWeb UI
e4PhotoDemo
e4Contacts
Demo
SWT is installed in the root
framework and shared with the
composites which require SWT
![Page 91: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/91.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Isolating SWT and e4 applications
Root Framework
SWT
AppConsoleWeb UI
e4PhotoDemo
e4Contacts
Demo
Application Descriptor and
Handle services are shared with
the Web UI
![Page 92: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/92.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Benefits of Composites
● Composite Bundles are persistent
– Content of composite is reified when the parent framework restarts
– Like a normal bundle, the active state is persisted
![Page 93: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/93.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Benefits of Composites
● Composite Bundles are persistent
– Content of composite is reified when the parent framework restarts
– Like a normal bundle, the active state is persisted
● Bundles can be grouped together into one executable unit
– Stopping a composite stops all constituent bundles
– Starting a composite starts the constituent bundles (which are marked for start)
![Page 94: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/94.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Benefits of Composites
● Composite Bundles are persistent
– Content of composite is reified when the parent framework restarts
– Like a normal bundle, the active state is persisted
● Bundles can be grouped together into one executable unit
– Stopping a composite stops all constituent bundles
– Starting a composite starts the constituent bundles (which are marked for start)
● High level of isolation
– Strict control over what is imported to and exported from the composite.
– Sharing is fine grained and transparent
![Page 95: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/95.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Difficulties with Composites
● Low-level API for installing content into composites– Equivalent to managing a complete framework
![Page 96: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/96.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Difficulties with Composites
● Low-level API for installing content into composites– Equivalent to managing a complete framework
● Limitations for sharing resources– Extenders do not understand composites (DS, Spring,
Blueprint, Extension Registry, iPOJO)
![Page 97: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/97.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Difficulties with Composites
● Low-level API for installing content into composites– Equivalent to managing a complete framework
● Limitations for sharing resources– Extenders do not understand composites (DS, Spring,
Blueprint, Extension Registry, iPOJO)
– Transparent sharing policy● Simplifies most things
![Page 98: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/98.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Difficulties with Composites
● Low-level API for installing content into composites– Equivalent to managing a complete framework
● Limitations for sharing resources– Extenders do not understand composites (DS, Spring,
Blueprint, Extension Registry, iPOJO)
– Transparent sharing policy● Simplifies most things● But violates academic notion of a composite
![Page 99: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/99.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Conclusion
● OSGi R4.3 is shaping up to be a big release– Still early, but some interesting things are far along
– OSGi API Updates
– Composite Bundles
● Composite Bundles– A powerful way to establish application isolation
– Provides a basis for defining subsystems
![Page 100: Eclipse Con2010 Composites](https://reader034.vdocument.in/reader034/viewer/2022042607/5549fe03b4c905e56c8b4d65/html5/thumbnails/100.jpg)
© 2010 by IBM Corp.; Licensed under the Creative Commons Att. Nc Nd 2.5 license
Legal Notices
● Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both
● Other company, product, or service names may be trademarks or service marks of others