SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
Multi-Bundle
                      Scoping in
                        OSGi
                                Glyn Normington


         50 µm lead sulphide
         assemblies each containing
         ~108 nanoparticles


Copyright VMware Inc. 2011. Licensed under the Eclipse Public License
Agenda
•Modules in Java
• Multi-bundle modules
• Scoping mechanisms
• Subsystems
Modules in Java
Modularity
the degree to which a system’s components
may be separated and recombined
the tightness of coupling between components
the degree to which the system architecture
controls the mixing and matching of components
Modularity
the degree to which a system’s components



information
may be separated and recombined
the tightness of coupling between components
the degree to which the system architecture



   hiding
controls 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 1
Feature

 bundle       bundle

 bundle       bundle
Example 2
Scoped App

  bundle       bundle

  bundle       bundle
Example 3
Kernel

bundle       bundle

bundle       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 Rewriting
Hide internals:
   • Decorate referents
    • Bundles and packages
    • Generic capabilities
   • Fix references
   • Use service registry hooks
Metadata Rewriting
     in Virgo

     Demo ...
Metadata Rewriting
Issues:
• 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 Bundle
Issues:
• 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 Hooks
Issues:
• 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 2
region X



      "allow p1, p3"



  p1, p2          "allow p3, p4"     p3, p4



region Y                           region Z
Example Digraph 2
      region X
                         visible: p1, p3



             "allow p1, p3"



         p1, p2          "allow p3, p4"     p3, p4



      region Y                            region Z
visible: 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
   “We're 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 API
public interface RegionDigraph ... {

	 Region createRegion(String regionName) throws BundleException;

    RegionFilterBuilder createRegionFilterBuilder();

    ...
}

public interface Region {

	 void connectRegion(Region headRegion, RegionFilter filter)
    throws BundleException;

    ...
}
Region Digraph
Issues:
• 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 Scoping

Subsystem type     Scoping

   application   contents hidden

   composite      configurable

    feature           none
Example 1

 Application


  Feature
Example 2
 Feature A


 Feature C


 Feature B
Example 3

Application A

Application B

Composite C
Scoping and Regions
Subsystem scoping can be
• defined in terms of
• implemented using
a region digraph
Complex Scoping 1
  App3

         FeatureQ
         FeatureR
         FeatureP

     CompositeC
Region Digraph
         Region A3
     App3   FeatureQ
              FeatureR
              FeatureP
                            App3

                                   FeatureQ
                                   FeatureR
Region C      CompositeC           FeatureP

                               CompositeC
Complex Scoping 2
        Root
    Application A
    Application B
    Composite C

    Composite D
    Application E
Region Digraph
         Root


App A   Comp D   App E
                             Root
                         Application A
                         Application B

App V   Comp C           Composite C

                         Composite D
                         Application E
Dependencies
        FeatureX

App1                App2

        FeatureY

       CompositeF
Installing Dependencies
                    Root
  "accept
transitive"


                 CompositeF



          App1                App2
Installing Dependencies
                  Root
  "accept
transitive"


               CompositeF



App1          App2   FeatureX   FeatureY
Region Digraph
Region    Region F     Region
 A1                     A2
          FeatureX

App1                   App2
          FeatureY

          CompositeF                    FeatureX

                                App1                App2

                                        FeatureY

                                       CompositeF
Conclusion
Modularity 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

Weitere ähnliche Inhalte

Andere mochten auch

Battle Of Small Thinking
Battle Of Small ThinkingBattle Of Small Thinking
Battle Of Small Thinking
gabi4
 
Vanessa Capogreco Full Resume 2015
Vanessa Capogreco Full Resume 2015Vanessa Capogreco Full Resume 2015
Vanessa Capogreco Full Resume 2015
Vanessa Capogreco
 
Experimento 1
Experimento 1Experimento 1
Experimento 1
wiledi
 
Going deeper, seeing further another pdf
Going deeper, seeing further another pdfGoing deeper, seeing further another pdf
Going deeper, seeing further another pdf
jdwyer25
 
Sabin nemeş – pictor din cluj 2
Sabin nemeş – pictor din cluj 2Sabin nemeş – pictor din cluj 2
Sabin nemeş – pictor din cluj 2
Claudiu Nemeş
 
Administración Financiera Madrid
Administración Financiera MadridAdministración Financiera Madrid
Administración Financiera Madrid
fernandina95
 
Cronologia base de datos
Cronologia base de datosCronologia base de datos
Cronologia base de datos
Aime Rodriguez
 

Andere mochten auch (18)

Desayuno cinco dias 2
Desayuno cinco dias 2Desayuno cinco dias 2
Desayuno cinco dias 2
 
Battle Of Small Thinking
Battle Of Small ThinkingBattle Of Small Thinking
Battle Of Small Thinking
 
Vanessa Capogreco Full Resume 2015
Vanessa Capogreco Full Resume 2015Vanessa Capogreco Full Resume 2015
Vanessa Capogreco Full Resume 2015
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled Presentation
 
Experimento 1
Experimento 1Experimento 1
Experimento 1
 
Index_IJoDS_V2_N1 (1)
Index_IJoDS_V2_N1 (1)Index_IJoDS_V2_N1 (1)
Index_IJoDS_V2_N1 (1)
 
Sistemas de información, organizaciones y estrategia
Sistemas de información, organizaciones y estrategiaSistemas de información, organizaciones y estrategia
Sistemas de información, organizaciones y estrategia
 
If you die in VR do you die
If you die in VR do you dieIf you die in VR do you die
If you die in VR do you die
 
BX2Exhibits
BX2ExhibitsBX2Exhibits
BX2Exhibits
 
TEST
TESTTEST
TEST
 
Ruzan Minasyan
Ruzan Minasyan Ruzan Minasyan
Ruzan Minasyan
 
Going deeper, seeing further another pdf
Going deeper, seeing further another pdfGoing deeper, seeing further another pdf
Going deeper, seeing further another pdf
 
FINAL (5)
FINAL (5)FINAL (5)
FINAL (5)
 
Sabin nemeş – pictor din cluj 2
Sabin nemeş – pictor din cluj 2Sabin nemeş – pictor din cluj 2
Sabin nemeş – pictor din cluj 2
 
Guiondecortometrajedelasexualidadenadolecentes
GuiondecortometrajedelasexualidadenadolecentesGuiondecortometrajedelasexualidadenadolecentes
Guiondecortometrajedelasexualidadenadolecentes
 
Administración Financiera Madrid
Administración Financiera MadridAdministración Financiera Madrid
Administración Financiera Madrid
 
Cronologia base de datos
Cronologia base de datosCronologia base de datos
Cronologia base de datos
 
What is Design Thinking? (Tim Brown, 2008)
What is Design Thinking? (Tim Brown, 2008)What is Design Thinking? (Tim Brown, 2008)
What is Design Thinking? (Tim Brown, 2008)
 

Ähnlich wie Multi-bundle Scoping in OSGi

Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
QAware GmbH
 
Solaris cluster roadshow day 1 sales overview
Solaris cluster roadshow day 1 sales overviewSolaris cluster roadshow day 1 sales overview
Solaris cluster roadshow day 1 sales overview
xKinAnx
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
James Chen
 

Ähnlich wie Multi-bundle Scoping in OSGi (20)

Eclipse Virgo
Eclipse VirgoEclipse Virgo
Eclipse Virgo
 
EclipseCon Europe 2011 Virgo 3.0
EclipseCon Europe 2011 Virgo 3.0EclipseCon Europe 2011 Virgo 3.0
EclipseCon Europe 2011 Virgo 3.0
 
Creating a Service Platform for .NET - Clément Escoffier, University of Grenoble
Creating a Service Platform for .NET - Clément Escoffier, University of GrenobleCreating a Service Platform for .NET - Clément Escoffier, University of Grenoble
Creating a Service Platform for .NET - Clément Escoffier, University of Grenoble
 
The A2530x24xx AIR Module for ZigBee Standard Applications
The A2530x24xx AIR Module for ZigBee Standard ApplicationsThe A2530x24xx AIR Module for ZigBee Standard Applications
The A2530x24xx AIR Module for ZigBee Standard Applications
 
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
 
Data Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture PatternsData Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture Patterns
 
CloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design PatternsCloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design Patterns
 
Rook - cloud-native storage
Rook - cloud-native storageRook - cloud-native storage
Rook - cloud-native storage
 
meetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypesmeetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypes
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Android
 
Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享
 
Solaris cluster roadshow day 1 sales overview
Solaris cluster roadshow day 1 sales overviewSolaris cluster roadshow day 1 sales overview
Solaris cluster roadshow day 1 sales overview
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment
 
HA and DR for Cloud Workloads
HA and DR for Cloud WorkloadsHA and DR for Cloud Workloads
HA and DR for Cloud Workloads
 
Apache Geode Meetup, London
Apache Geode Meetup, LondonApache Geode Meetup, London
Apache Geode Meetup, London
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Multi-bundle Scoping in OSGi

  • 1. Multi-Bundle Scoping in OSGi Glyn Normington 50 µm lead sulphide assemblies each containing ~108 nanoparticles Copyright VMware Inc. 2011. Licensed under the Eclipse Public License
  • 2. Agenda •Modules in Java • Multi-bundle modules • Scoping mechanisms • Subsystems
  • 4. Modularity the degree to which a system’s components may be separated and recombined the tightness of coupling between components the degree to which the system architecture controls the mixing and matching of components
  • 5. Modularity the degree to which a system’s components information may be separated and recombined the tightness of coupling between components the degree to which the system architecture hiding controls the mixing and matching of components
  • 6. Modules in Java • Class • Package • JAR • Class loader } OSGi bundle • Module - Java 8 • Larger scale modules?
  • 8. Information to Hide • Bundle • Package • Generic capability • Service
  • 9. Example 1 Feature bundle bundle bundle bundle
  • 10. Example 2 Scoped App bundle bundle bundle bundle
  • 11. Example 3 Kernel bundle bundle bundle bundle
  • 13. Scoping Mechanisms • x-internal/x-friends • metadata rewriting • composite bundle • framework hooks • region digraph
  • 14. Eclipse x-* Directives • Export-Package directives • Enforced by framework • x-internal • x-friends • Non-standard • Naming friends is brittle ➡ Standard, maintainable mechanism
  • 15. Metadata Rewriting Hide internals: • Decorate referents • Bundles and packages • Generic capabilities • Fix references • Use service registry hooks
  • 16. Metadata Rewriting in Virgo Demo ...
  • 17. Metadata Rewriting Issues: • Suitable for isolated applications only • Intrusive • Complicates bundle update • Can be coded round • Non-standard ➡ Standard scoping in the framework
  • 18. 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
  • 19. Composite Bundle Issues: • Implemented in the framework • Cannot expose constituent bundles • Hard to spec portably ➡ Superseded
  • 20. 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
  • 21. Framework Hooks Issues: • Low level • Consistency of hooks • Coexistence of sets of hooks ➡ Higher level API needed
  • 24. Tree
  • 25. DAG
  • 27. Graph
  • 28. Region Digraph • Framework hook abstraction • Bundles partitioned into regions • Regions connected by filters • Bundles • Packages • Generic capabilities • Services
  • 29. Example Digraph region A p3 "allow p1" p1, p2 region B
  • 30. Example Digraph region A visible: p1, p3 p3 "allow p1" p1, p2 visible: p1, p2 region B
  • 31. Example Digraph 2 region X "allow p1, p3" p1, p2 "allow p3, p4" p3, p4 region Y region Z
  • 32. Example Digraph 2 region X visible: p1, p3 "allow p1, p3" p1, p2 "allow p3, p4" p3, p4 region Y region Z visible: p1, p2, p3, p4
  • 33. Region Digraph • Equinox bundle • Runs on standard framework hooks • Persistent • JMX
  • 34. 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 “We're using [the region digraph] kernel essentially for a fully multi-tenant plugin system to Web applications.” Robert Sauer
  • 35. Region Digraph in Virgo Demo ...
  • 36. Region Digraph API public interface RegionDigraph ... { Region createRegion(String regionName) throws BundleException; RegionFilterBuilder createRegionFilterBuilder(); ... } public interface Region { void connectRegion(Region headRegion, RegionFilter filter) throws BundleException; ... }
  • 37. Region Digraph Issues: • Too low level for application use • Non-standard ➡ Standard, high-level programming model
  • 39. Why Subsystems? 5 projects have multi-bundle constructs • Poor portability • Inconsistent terminology • Diverse function ➡ Standard
  • 40. Subsystems • OSGi Enterprise Expert Group • Scoping based on composite bundles framework hooks • Public draft available (“RFC 152”)
  • 41. What is a Subsystem? • Group of constituents with dependencies • Constituents: bundles, subsystems, ... • Dependencies: loosely coupled pre-reqs • Named and versioned • Defined lifecycle
  • 42. Subsystem Scoping Subsystem type Scoping application contents hidden composite configurable feature none
  • 44. Example 2 Feature A Feature C Feature B
  • 46. Scoping and Regions Subsystem scoping can be • defined in terms of • implemented using a region digraph
  • 47. Complex Scoping 1 App3 FeatureQ FeatureR FeatureP CompositeC
  • 48. Region Digraph Region A3 App3 FeatureQ FeatureR FeatureP App3 FeatureQ FeatureR Region C CompositeC FeatureP CompositeC
  • 49. Complex Scoping 2 Root Application A Application B Composite C Composite D Application E
  • 50. Region Digraph Root App A Comp D App E Root Application A Application B App V Comp C Composite C Composite D Application E
  • 51. Dependencies FeatureX App1 App2 FeatureY CompositeF
  • 52. Installing Dependencies Root "accept transitive" CompositeF App1 App2
  • 53. Installing Dependencies Root "accept transitive" CompositeF App1 App2 FeatureX FeatureY
  • 54. Region Digraph Region Region F Region A1 A2 FeatureX App1 App2 FeatureY CompositeF FeatureX App1 App2 FeatureY CompositeF
  • 55. Conclusion Modularity in Java: • Class, package, JAR, class loader • Modules in Java 8 • Larger modules? Modularity in OSGi: • Bundles • Multi-bundle modules • Subsystems
  • 56. 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
  • 57. Thanks to... • Wikipedia image courtesy of Wikipedia.org • Field of Flowers by Paul Podsiadlo and Elena Shevchenko, courtesy of Argonne National Laboratory