• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Conole vilnius 3_nov
 

Conole vilnius 3_nov

on

  • 842 views

 

Statistics

Views

Total Views
842
Views on SlideShare
842
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Conole vilnius 3_nov Conole vilnius 3_nov Presentation Transcript

  • Multi-Bundle Scoping in OSGi Glyn Normington 50 µm lead sulphide assemblies each containing ~108 nanoparticlesCopyright VMware Inc. 2011. Licensed under the Eclipse Public License
  • Agenda•Modules in Java• Multi-bundle modules• Scoping mechanisms• Subsystems
  • Modules in Java
  • Modularitythe degree to which a system’s componentsmay be separated and recombinedthe tightness of coupling between componentsthe degree to which the system architecturecontrols the mixing and matching of components
  • Modularitythe degree to which a system’s componentsinformationmay be separated and recombinedthe tightness of coupling between componentsthe degree to which the system architecture hidingcontrols the mixing and matching of components
  • Modules in Java• Class• Package• JAR• Class loader } OSGi bundle• Module - Java 8• Larger scale modules?
  • Multi-Bundle Modules
  • Information to Hide• Bundle• Package• Generic capability• Service
  • Example 1Feature bundle bundle bundle bundle
  • Example 2Scoped App bundle bundle bundle bundle
  • Example 3Kernelbundle bundlebundle bundle
  • Scoping Mechanisms
  • Scoping Mechanisms• x-internal/x-friends• metadata rewriting• composite bundle• framework hooks• region digraph
  • Eclipse x-* Directives• Export-Package directives• Enforced by framework• x-internal• x-friends• Non-standard• Naming friends is brittle➡ Standard, maintainable mechanism
  • Metadata RewritingHide internals: • Decorate referents • Bundles and packages • Generic capabilities • Fix references • Use service registry hooks
  • Metadata Rewriting in Virgo Demo ...
  • Metadata RewritingIssues:• Suitable for isolated applications only• Intrusive• Complicates bundle update• Can be coded round• Non-standard➡ Standard scoping in the framework
  • Composite Bundle• OSGi draft spec• Prototyped in Equinox, deprecated• Uses framework instance• Surrogate bundle represents “parent”• Used in Virgo 2.1 to isolate the kernel
  • Composite BundleIssues:• Implemented in the framework• Cannot expose constituent bundles• Hard to spec portably➡ Superseded
  • Framework Hooks• Part of OSGi 4.3 core• Control visibility• Enable framework to be partitioned• 5 main hooks: • resolver hook • bundle find/event hooks • service find/event hooks
  • Framework HooksIssues:• Low level• Consistency of hooks• Coexistence of sets of hooks➡ Higher level API needed
  • Region Digraph
  • Graph Theory Interlude
  • Tree
  • DAG
  • Digraph
  • Graph
  • Region Digraph• Framework hook abstraction• Bundles partitioned into regions• Regions connected by filters • Bundles • Packages • Generic capabilities • Services
  • Example Digraph region A p3 "allow p1" p1, p2 region B
  • Example Digraph region A visible: p1, p3 p3 "allow p1" p1, p2 visible: p1, p2 region B
  • Example Digraph 2region X "allow p1, p3" p1, p2 "allow p3, p4" p3, p4region Y region Z
  • Example Digraph 2 region X visible: p1, p3 "allow p1, p3" p1, p2 "allow p3, p4" p3, p4 region Y region Zvisible: p1, p2, p3, p4
  • Region Digraph• Equinox bundle• Runs on standard framework hooks• Persistent• JMX
  • Region Digraph Uses user region• Virgo 3.0 kernel/user region p3 s3, s4 b3• Apache Aries “subsystems” "allow s3" "allow p1, s1, b1" prototype (service of p1 type)• Standalone: p1, p2 s1, s2 b1, b2 “Were using [the region digraph] kernel essentially for a fully multi-tenant plugin system to Web applications.” Robert Sauer
  • Region Digraph in Virgo Demo ...
  • Region Digraph APIpublic interface RegionDigraph ... { Region createRegion(String regionName) throws BundleException; RegionFilterBuilder createRegionFilterBuilder(); ...}public interface Region { void connectRegion(Region headRegion, RegionFilter filter) throws BundleException; ...}
  • Region DigraphIssues:• Too low level for application use• Non-standard➡ Standard, high-level programming model
  • Subsystems
  • Why Subsystems?5 projects have multi-bundle constructs• Poor portability• Inconsistent terminology• Diverse function➡ Standard
  • Subsystems• OSGi Enterprise Expert Group• Scoping based on composite bundles framework hooks• Public draft available (“RFC 152”)
  • What is a Subsystem?• Group of constituents with dependencies • Constituents: bundles, subsystems, ... • Dependencies: loosely coupled pre-reqs• Named and versioned• Defined lifecycle
  • Subsystem ScopingSubsystem type Scoping application contents hidden composite configurable feature none
  • Example 1 Application Feature
  • Example 2 Feature A Feature C Feature B
  • Example 3Application AApplication BComposite C
  • Scoping and RegionsSubsystem scoping can be• defined in terms of• implemented usinga region digraph
  • Complex Scoping 1 App3 FeatureQ FeatureR FeatureP CompositeC
  • Region Digraph Region A3 App3 FeatureQ FeatureR FeatureP App3 FeatureQ FeatureRRegion C CompositeC FeatureP CompositeC
  • Complex Scoping 2 Root Application A Application B Composite C Composite D Application E
  • Region Digraph RootApp A Comp D App E Root Application A Application BApp V Comp C Composite C Composite D Application E
  • Dependencies FeatureXApp1 App2 FeatureY CompositeF
  • Installing Dependencies Root "accepttransitive" CompositeF App1 App2
  • Installing Dependencies Root "accepttransitive" CompositeFApp1 App2 FeatureX FeatureY
  • Region DigraphRegion Region F Region A1 A2 FeatureXApp1 App2 FeatureY CompositeF FeatureX App1 App2 FeatureY CompositeF
  • ConclusionModularity in Java:• Class, package, JAR, class loader• Modules in Java 8• Larger modules?Modularity in OSGi:• Bundles• Multi-bundle modules• Subsystems
  • Further Information• Public draft of subsystems (RFC 152) • http://www.osgi.org/Download/File?url=/download/osgi-early-draft-2011-09.pdf• Region digraph • http://underlap.blogspot.com/2011/05/equinox-digraph-ready-for-use.html• Eclipse Virgo and the region digraph • https://bugs.eclipse.org/bugs/show_bug.cgi?id=330776• Apache Aries use of region digraph • https://issues.apache.org/jira/browse/ARIES-644• Multi-module modules and Java 8 • http://mail.openjdk.java.net/pipermail/jigsaw-dev/2011-October/001564.html
  • Thanks to...• Wikipedia image courtesy of Wikipedia.org• Field of Flowers by Paul Podsiadlo and Elena Shevchenko, courtesy of Argonne National Laboratory