• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Subsystems: For those occasions where bundles are just too small... - Graham Charters
 

Subsystems: For those occasions where bundles are just too small... - Graham Charters

on

  • 4,070 views

Enterprise OSGi 4.2 standardized the use of a number of component models for developing Enterprise OSGi applications: Servlet, JSP, Blueprint, and JPA. Implementations of these specifications have ...

Enterprise OSGi 4.2 standardized the use of a number of component models for developing Enterprise OSGi applications: Servlet, JSP, Blueprint, and JPA. Implementations of these specifications have since become available in many open source projects and products such as Apache Aries, Eclipse Gemini/Virgo, GlassFish, JBoss Application Server and WebSphere Application Server. Looking at a number of these environments, it's clear that when it comes to assembly and deployment there's still something missing, namely something to represent a collection of bundles (e.g. an Application). Eclipse Virgo has "PARs" and "Plans", Apache Aries has "Applications", and WebSphere Application Server has “Applications” and “Composites”. Looking further afield to kernel projects, other bundle collection concepts exist, such as Apache Karaf "Features". Each model has concepts in common, such as identity, versioning and content, but also differences like isolation and format. It is clear that this is an area of Enterprise OSGi that could benefit from standardization and hence the Subsystems specification is being created. Subsystems is currently a draft specification which is standardizing artefacts representing collections of bundles, such as an Application. This presentation will introduce the current Subsystems design. It will describe how Subsystems can be used for development and deployment of bundle collections with different isolation semantics, to address the application, composite and feature use cases seen in the OSGi community today.

Statistics

Views

Total Views
4,070
Views on SlideShare
4,070
Embed Views
0

Actions

Likes
2
Downloads
105
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Subsystems: For those occasions where bundles are just too small... - Graham Charters Subsystems: For those occasions where bundles are just too small... - Graham Charters Presentation Transcript

    • Subsystems:for those occassions where bundles are just too smallGraham ChartersIBM21st September 2011 OSGi Alliance Marketing © 2008-2010 . 1 PageCOPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved, © IBM Corp. 2011 All Rights Reserved
    • Disclaimer• Subsystems is an in-progress RFC. What follows is a snapshot in time of the expert group thinking and is subject to change. Page 2 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Agenda• Motivation• Model• Development Meta-data• Deployment Meta-data• Packaging• Life-cycle• API Page 3 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Motivation• Enterprise Java platforms are awash with bundle collections • Apache Aries – Applications • Apache Geronimo - Applications • Apache Karaf – Features • Eclipse Virgo – Plans, PARs • IBM WebSphere Application Server – Applications and Composite • Oracle GlassFish – Applications • Paremus Service Fabric – Systems• Crying out for standardization • Portability • Tools • Ecosystem Page 4 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Subsystems Model: Hierarchy• Most common model is subsystem hierarchy and so Subsystems are no subsystem different • Each has 1 parent subsystem • Each can have many children subsystem subsystem • Children of the same parent are siblings• Visually represented by subsystem subsystem containment Page 5 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Subsystem Model: Sharing Policies• Subsystems may provide and consume capabilities • E.g. packages, services, etc…• Different subsystem types have different default sharing policies • E.g. share everything, share nothing, provide nothing• Subsystem types that provide isolation may also have affinity – i.e. prefer the capabilities of their contents Page 6 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Feature Subsystems feature bundle• Collection of Resources (e.g. Bundles) feature• Shared life-cycle bundle• Can be nested• No isolation or affinity bundle• Repository-based bundle provisioning• Examples: Karaf Features, Virgo unscoped Plans bundle bundle Page 7 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Composite Subsystems • Coarse-grained sub- bundle assembly module • Isolated composite • Explicit share in/out bundle • Affinity bundle • Repository-based provisioning bundle • Examples: RFC 138 Composite Bundles*, WebSphere Composite bundle bundle Bundles Page 8 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011*old design prior to resolver hooks
    • Application Subsystems• Model for hosted applications• Isolated application bundle• No sharing out, implicit sharing in bundle• Affinity bundle• Repository-based provisioning• Examples: Aries bundle bundle Application, Virgo Scoped Plans, Virgo PARs Page 9 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Example Combination• Subsystem Types can be mixed ‘n’ matched framework• Example shows: application application • Features used to assemble a Composite • Composite providing a ‘platform’ to composite Applications feature feature feature Page 10 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Developer Headers• Manifest format with relaxed rules• Common concepts use same headers• Some headers unique to Subsystem type• Headers cover: • Identity • Content • Isolation policy • Human readable information Page 11 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Identity Headers• Identified by symbolic name and version Manifest-Version: 1.0 Subsystem-ManifestVersion: 1.0• All subsystem types Subsystem-SymbolicName: my.first.subsystem live in the same Subsystem-Version: 1.0.0 namespace so type not part of the identity Page 12 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Type Header• Type governs the sharing policy• Standard Types: Manifest-Version: 1.0 • osgi.application (the default) Subsystem-ManifestVersion: 1.0 • osgi.composite Subsystem-SymbolicName: my.first.subsystem • osgi.feature Subsystem-Version: 1.0.0 Subsystem-Type:• All subsystem types live in osgi.application; same resource type provision-policy:=acceptTransitive (osgi.subsystem), so their subsystem type is not part of their identity• One directive used in provisioning (see later) Page 13 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Content • Identifies the resources contained in the Subsystem Manifest-Version: 1.0 Subsystem-ManifestVersion: 1.0 • Resources identified by name, Subsystem-SymbolicName: my.first.Subsystem version (range) and type Subsystem-Version: 1.0.0 • Composites only allow fixed Subsystem-Type: versions osgi.application; provision-policy:=acceptTransitive • Standard types Subsystem-Content: an.osgi.bundle1;version="[1.0, 1.1)", • osgi.bundle (default) an.osgi.subsystem; • osgi.subsystem type:=osgi.subsystem; version="[1.2, 1.3)", • osgi.configuration* an.osgi.config; • Can be optional type:=osgi.configuration; version="[1.0, 1.1)"; resolution:=optional*if we get there… Page 14 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Informational Manifest-Version: 1.0• Headers for humans Subsystem-ManifestVersion: 1.0 Subsystem-Name: First Subsystem• Localized just like bundles Subsystem-Description: This is my first ever Subsystem and its sooo cool. Subsystem-SymbolicName: my.first.subsystem Subsystem-Version: 1.0.0 Subsystem-Type: osgi.application; provision-policy:=acceptTransitive Subsystem-Content: an.osgi.bundle;version="[1.0, 1.1)", an.osgi.subsystem; type:=osgi.subsystem; version="[1.2, 1.3)", an.osgi.config; type:=osgi.configuration; version="[1.0, 1.1)" Page 15 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Explicit Sharing Manifest-Version: 1.0 Subsystem-ManifestVersion: 1.0 Subsystem-Name: A Composite Subsystem Subsystem-Description: This is a Composite Subsystem Subsystem-SymbolicName: my.first.composite Subsystem-Version: 1.0.0• Composite subsystems Subsystem-Type: osgi.composite Subsystem-Content: share nothing unless an.osgi.bundle1;version="[1.0, 1.0]", explicitly stated an.osgi.bundle2;version="[1.0, 1.0]" Subsystem-ExportService:• Re-use existing bundle exported.service.Interface; headers where applicable filter:="(color=blue)" Subsystem-ImportService:• Not applicable for implicitly imported.service.Interface isolated subsystems (i.e. Export-Package: an.exported.pkg;version="1.0" Features and Import-Package: Applications) an.imported.pkg;version="[1.0, 2.0)" Require-Bundle: a.required.bundle; bundle-version="[1.0, 2.0)" Page 16 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Locking down deployment• Subsystem manifest allows version variability • Enables flexibility during development • Bounds operational upgrade• Desirable to lock down versions during QA • Carry same deployment from testing to production• Deployment Manifest • Locks down contents to specific versions • Identifies supporting transitive dependencies • Describes package/service import/export details Page 17 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Deployment ManifestDESCRIPT’N SUBSYSTEM.MF DEPLOYMENT.MFBoilerplate Manifest-Version: 1.0 Manifest-Version: 1.0 Subsystem-ManifestVersion: 1.0 Deployment-ManifestVersion: 1.0Identity + Subsystem-SymbolicName: Subsystem-SymbolicName:Subsystype my.first.subsystem my.first.subsystem Subsystem-Version: 1.0.0 Subsystem-Version: 1.0.0 Subsystem-Type: osgi.applicationContent Subsystem-Content: Deployed-Content: an.osgi.bundle;version="[1.0, 1.1)", an.osgi.bundle;type:=osgi.bundle; an.osgi.subsystem;type:=osgi.subsystem; deployed-version=1.0.0, version="[1.2, 1.3)", an.osgi.subsystem;type:=osgi.subsystem; an.osgi.config;type:=osgi.configuration; deployed-version=1.2.0, version="[1.0, 1.1)"; an.osgi.config;type:=osgi.configuration; resolution:=optional deployed-version=1.0.5Transitive <Only part of the deployment> Provision-Resource:Dependencies an.osgi.bundle2;type:=osgi.bundle; deployed-version=1.0.0 an.osgi.bundle3;type:=osgi.bundle; deployed-version=1.0.0Sharing Policy <Implicit for Application Subsystems> Deployed-ServiceImport: (objectClass=an.osgi.Service) Import-Package: a.pkg;version="1.0.0", a.pkg2;version="1.4" Page 18 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Manifest-Version: 1.0 ExampleDeployment-ManifestVersion: 1.0Subsystem-SymbolicName:my.first.subsystemSubsystem-Version: 1.0.0Deployed-Content: an.osgi.bundle;type:=osgi.bundle; deployed-version=1.0.0, application an.osgi.subsystem;type:=osgi.subsystem; deployed-version=1.2.0, an.osgi.config; config subsystem type:=osgi.configuration; deployed-version=1.0.5Provision-Resource: an.osgi.bundle2;type:=osgi.bundle; bundle deployed-version=1.0.0 an.osgi.bundle3;type:=osgi.bundle; deployed-version=1.0.0 Service pkg pkg2Deployed-ServiceImport: (objectClass=an.osgi.Service)Import-Package: a.pkg;version="1.0.0", bundle3 bundle2 a.pkg2;version="1.4" Page 19 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Transitive Subsystem-Type: osgi.composite;Dependencies provision-policy:=acceptTransitive Subsystem-Type:• Provision-Resource identifies osgi.application resources to be provisioned in Subsystem-Type: support of a Subsystem config osgi.composite• A Subsystem can choose to accept transitive dependencies from itself and its children bundle Subsystem-Type: osgi.composite; provision-policy:=acceptTransitive Service pkg pkg2• The Root Subsystem always accepts transitive dependencies• Sharing policies need to be correct bundle3 bundle2 to ensure children can see their transitive dependencies Transitive Dependencies Page 20 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Portability• Subsystem Manifests are portable to a point • Target Environment + Subsystem Definition Transitive Dependencies must support the required resource implementation types (e.g. Transitive Blueprint, WAB, DS, etc) Dependencies• Deployment manifests may be portable Target Environment • Different Target Environments likely to require different Transitive Dependencies Page 21 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Packaging• Packaged in a Subsystem my.first.subsystem.ssa Archive• A zip file with .ssa OSGI-INF/SUBSYSTEM.MF extension: OSGI-INF/DEPLOYMENT.MF • Subsystem Manifest (optional) an.osgi.bundle-1.0.0.jar • Deployment Manifest (optional) an.osgi.bundle2-1.0.0.jar • Resources (optional) Page 22 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Life-cycle install INSTALLING• Life-cycle similar to that of INSTALLED UPDATING bundles update resolve• Adds ‘transitional states’ uninstall to reflect periods where RESOLVING STARTING contents are in process of changing state RESOLVED ACTIVE uninstall • E.g. INSTALLING, stop RESOLVING, … STOPPING UNINSTALLIN G UNINSTALLED Page 23 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Shared resource life-cycle• Resources may be shared between Subsystems • Intersecting Features ACTIVE • Common transitive dependencies• Shared resource states determined by states of RESOLVED Subsystems that depend on them• State precedence used to INSTALLED determine shared resource state • Highest state wins • All uninstalled == garbage UNSTALLED collection Page 24 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Application SubsystemExample installed and resolved Composite ACTIVE Application RESOLVED bundle RESOLVED transitive bundle RESOLVED Page 25 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Second ApplicationExample Subsystem installed and started Composite ACTIVE Application RESOLVED Application ACTIVE bundle bundle RESOLVED ACTIVE transitive bundle transitive bundle ACTIVE ACTIVE Page 26 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Second ApplicationExample Subsystem uninstalled Composite ACTIVE Application RESOLVED Application UNINSTALLED bundle bundle RESOLVED UNINSTALLED transitive bundle transitive bundle RESOLVED UNINSTALLED Page 27 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • First Application SubsystemExample uninstalled Composite ACTIVE Application UNINSTALLED Application UNINSTALLED bundle bundle UNINSTALLED UNINSTALLED transitive bundle transitive bundle UNINSTALLED UNINSTALLED Page 28 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Subsystem Service• Each subsystem framework logically has it’s own application Subsystem service • An environment can choose to hide for certain subsystems composite• Life-cycle management • Install, start, stop, uninstall, feature feature cancel• Navigation feature • getParent, getChildren, getConstituents• Introspection • getHeaders, getState, getSymbolicName, getVersion, getLocation Page 29 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • Summary• Subsystems are the standard way to manage groups of resources• Version ranges allow flexibility in resource selection• Subsystem types define sharing semantics• Deployment definition • locks down versions and sharing • Identifies transitive dependencies• API enables management of Subsystem life-cycle Page 30 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011
    • TrademarksIBM and WebSphere are trademarks or registered trademarks ofInternational Business Machines Corp., registered in manyjurisdictions worldwide.Java and all Java-based trademarks and logos are trademarks orregistered trademarks of Oracle and/or its affiliates.Other product and service names might be trademarks of IBM or othercompanies. A current list of IBM trademarks is available on the Web at“Copyright and trademark information” atwww.ibm.com/legal/copytrade.shtml. Page 31 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, 26.09.2011 © IBM Corp. 2011