SlideShare uma empresa Scribd logo
1 de 58
OSGi 4.3 Technical Update:
What's New?
BJ Hargrave, IBM
Generics

• Framework API feels “old-
  fashioned”


   • Lack of generics


   • Uses of arrays and null
     return


• Generics have been held back
  because the embedded world
  is still still based upon Java 1.4
-target jsr14

• Developed to compile Java 5 code for 1.4 JREs
-target jsr14

• Developed to compile Java 5 code for 1.4 JREs


• All compilers recognize the


    • -source 1.5 -target jsr14 switches
-target jsr14

• Developed to compile Java 5 code for 1.4 JREs


• All compilers recognize the


    • -source 1.5 -target jsr14 switches


• Output class format 48 (1.4)


    • Stores generics in skippable attributes


    • Avoids Java 5 introduced types/members
-target jsr14

• Developed to compile Java 5 code for 1.4 JREs


• All compilers recognize the


    • -source 1.5 -target jsr14 switches


• Output class format 48 (1.4)


    • Stores generics in skippable attributes


    • Avoids Java 5 introduced types/members


• Works like a charm, but …


    • No annotations


    • No enums
Framework & ServiceTracker “generified”

ServiceReference<S> getServiceReference(Class<S>);


Collection<ServiceReference<S>> getServiceReferences(
 Class<S>, …);


ServiceRegistration<S> registerService(Class<S>, …)


new ServiceTracker<S,T>(context, Class<S>, null);
Type Safe use of Services

ServiceReference lr =
context.getServiceReference(LogService.class.getName());
LogService log = (LogService)context.getService(lr);


becomes


ServiceReference<LogService> lr =
context.getServiceReference(LogService.class);
LogService log = context.getService(lr);
Type Safe use of Services

ServiceReference[] rs =
 context.getServiceReferences(EventAdmin.class.getName(),
 …);


becomes


Collection<ServiceReference<EventAdmin>> rs =
 context.getServiceReferences(EventAdmin.class, …);


There can be some source incompatibilities since using null for the service
type argument is now ambiguous.
Type Safe use of Services

ServiceRegistration sr =
context.registerService(
 ConfigurationListener.class.getName(), …)


becomes


ServiceRegistration<ConfigurationListener> sr =
context.registerService(ConfigurationListener.class, …)
Type Safe use of Services

ServiceTracker st = new ServiceTracker(
  context, EventListener.class, null);
st.open();
EventListener el = (EventListener)st.getService();


becomes


ServiceTracker<EventListener,EventListener> st =
new ServiceTracker<EventListener,EventListener>(
 context, EventListener.class, null);
st.open();
EventListener el = st.getService();
Capabilities

• A capability is a set of attributes in a namespace
Capabilities

• A capability is a set of attributes in a namespace


• Built-in capabilities


   • osgi.wiring.package: Export-Package


   • osgi.wiring.bundle: Bundle-SymbolicName


   • osgi.wiring.host: Bundle-SymbolicName
Capabilities

• A capability is a set of attributes in a namespace


• Built-in capabilities


   • osgi.wiring.package: Export-Package


   • osgi.wiring.bundle: Bundle-SymbolicName


   • osgi.wiring.host: Bundle-SymbolicName


• Generic capabilities: Provide-Capability manifest header
Requirements

• A requirement is a filter expression over the attribute set of a capability
Requirements

• A requirement is a filter expression over the attribute set of a capability


• Built-in requirements


   • osgi.wiring.package: Import-Package


   • osgi.wiring.bundle: Require-Bundle


   • osgi.wiring.host: Fragment-Host
Requirements

• A requirement is a filter expression over the attribute set of a capability


• Built-in requirements


   • osgi.wiring.package: Import-Package


   • osgi.wiring.bundle: Require-Bundle


   • osgi.wiring.host: Fragment-Host


• Generic requirements: Require-Capability manifest header
7,*&4%.F','#"?;%#"7".*'*)','&,(,:%3%*15'D;./3"+'&,.').31'(#)$%/"'*4"%#'&,(,:%3%*%"+'94".'*4"%#'
                     #"?;%#"7".*+',#"'+,*%+-%"/2'*4,*'%+2'#"?;%#"7".*+',#"'*#,.+%*%$"5'
             G4"'H"?;%#"@E,(,:%3%*1',./'I#)$%/"@E,(,:%3%*1'4",/"#+',#"'7,.%-"+*'4",/"#+'*4,*''&-0"(&'F"."#%&'
             #"?;%#"7".*+',./'&,(,:%3%*%"+'%.',.1'.,7"'+(,&"5'J)9"$"#2','.;7:"#')-'7,.%-"+*'4",/"#+'%.'*4"'
             C!K%'+("&%-%&,*%).+',#"',&*;,331'#"?;%#"7".*+').'&,(,:%3%*%"+'+("&%-%"/':1')*4"#'C!K%'7,.%-"+*'4",/@
 Capabilities and Requirements
             "#+5'=)#'"<,7(3"2',.'67()#*@I,&0,F"'&3,;+"'%+','#"?;%#"7".*').'*4"'&,(,:%3%*1'+("&%-%"/':1'*4"'L<()#*@
             I,&0,F"'&3,;+"5'G4%+'+("&%-%&,*%).'*4"#"-)#"'&).*,%.+','.;7:"#')-'.,7"'+(,&"+'-)#'*4"+"'C!K%'7,.%@
             -"+*'4",/"#+M'+1&$23$#$%&245%6,-2'+1&$23$#$%&278.98&-2',./'+1&$23$#$%&2:+1"5'G4"+"'.,7"'+(,&"+'
             %.-3;".&"'*4"'#"+)3$"#',./'/"-%."'*4"'&3,++'3),/%.F'(#)&"++5'=)#'"<,7(3"2','H"?;%#"@D;./3"'&3,;+"'%+','
 •   Additional resolver constraint
             #"?;%#"7".*'*4,*'".+;#"+'*4,*'*4"'"<()#*"/'(,&0,F"+')-'*4"'#"?;%#"/':;./3"',#"',$,%3,:3"'*)'*4"'
             #"?;%#"#N+'&3,++'3),/"#5
               H"?;%#"7".*+',./'E,(,:%3%*%"+',#"''&-0"(&''%.',':;./3"5'G4"'C!K%'-#,7"9)#0'&,.'*4".'7,*&4'*4"'
               #"?;%#"7".*+'*)'&,(,:%3%*%"+')-')*4"#':;./3"+'%.'*4"'(&!304$,5'(4,+"5'>':;./3"'&,.').31'#;.'94".'%*'%+'
 •   Each non-optional requirement must be satisfied by a capability
               #"+)3$"/',./'*4"#"-)#"'%*+'/"("./".&%"+',#"'+,*%+-%"/5'G4"'#"+)3$"#'&#",*"+'6$(&!':"*9"".'*4"'#"?;%#"@
               7".*+',./'&,(,:%3%*%"+O'*4"'/"&3,#%.F':;./3"'%+'.)*',39,1+'*4"'+,7"',+'*4"'4)+*%.F':;./3"5'G4"'#"+)3$@
               %.F'(#)&"++'%+'/"+&#%:"/'%.'7&!304$,518(3-&!!').'(,F" PQ5'G4"'/%,F#,77%.F'*"&4.%?;"')-'*4"'
 •   Visible in the wiring of the bundles
               H"?;%#"7".*RE,(,:%3%*1'7)/"3'%+'/"(%&*"/'%.'=%F;#"'S5T2'*4"'/"*,%3+')-'*4"'9%#%.F',#"'-;#*4"#'
               "<(3,%."/'%.'9*,'0&1:$($,51;8<1=.&-$%$-"#$3,').'(,F" QSU5

>$5*(&1?@A           7&)*$(&+&,#!1",'1B"."/$0$#$&!1",'1#C&$(1:$($,5


                                                                                                        <-=5$#->-%"

                                                                                                        *8784$,$";

                                                                                                        A5%6,-

                                                                                                        <-=5$#->-%"?*8784$,$";
              :+1"                                                        @#8&>-%"                      <5%"$>-




!"!"+                ,-./%0$12*$13.*$
osgi.ee Capabilities and Requirements

• Replacement for org.osgi.framework.executionenvironment and
  Bundle-RequiredExecutionEnvironment
osgi.ee Capabilities and Requirements

• Replacement for org.osgi.framework.executionenvironment and
  Bundle-RequiredExecutionEnvironment


• Provide-Capability: osgi.ee; osgi.ee="OSGi/Minimum";
     version:List<Version>="1.0,1.1,1.2",
   osgi.ee; osgi.ee="JavaSE";
     version:List<Version>="1.2,1.3,1.4,1.5,1.6"
osgi.ee Capabilities and Requirements

• Replacement for org.osgi.framework.executionenvironment and
  Bundle-RequiredExecutionEnvironment


• Provide-Capability: osgi.ee; osgi.ee="OSGi/Minimum";
     version:List<Version>="1.0,1.1,1.2",
   osgi.ee; osgi.ee="JavaSE";
     version:List<Version>="1.2,1.3,1.4,1.5,1.6"


• Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)
  (version>=1.6))"
adapt

• Replacing Framework services


  • Bundle was almost always parameter, not very
    OO
adapt

• Replacing Framework services


   • Bundle was almost always parameter, not very
     OO


• The Bundle.adapt method adapts a Bundle object
  to another type (if supported)


   • <A> A adapt( Class<A> type )
                                                    <A>
adapt

• Replacing Framework services


   • Bundle was almost always parameter, not very
     OO


• The Bundle.adapt method adapts a Bundle object
  to another type (if supported)


   • <A> A adapt( Class<A> type )
                                                    <A>
• Returned objects match the life cycle of the
  adapted bundle.
Replacements

• PackageAdmin service   Bundle Wiring API


  • BundleWiring wiring =
    bundle.adapt(BundleWiring.class)




                                             <A>
Replacements

• PackageAdmin service      Bundle Wiring API


   • BundleWiring wiring =
     bundle.adapt(BundleWiring.class)


• StartLevel service   Start Level API


   • BundleStartLevel bsl =
                                                <A>
     bundle.adapt(BundleStartLevel.class)
Replacements

• PackageAdmin service      Bundle Wiring API


   • BundleWiring wiring =
     bundle.adapt(BundleWiring.class)


• StartLevel service   Start Level API


   • BundleStartLevel bsl =
                                                    <A>
     bundle.adapt(BundleStartLevel.class)


• PackageAdmin and StartLevel are not in Core 4.3
  spec but frameworks will still implement them
Bundle Wiring API

                    Bundle
Bundle Wiring API

                    Bundle

                    adapt




                     Bundle
                    Revision
Bundle Wiring API

                      Bundle

                      adapt




          Bundle       Bundle     Bundle
        Requirement   Revision   Capability
Bundle Wiring API

                      Bundle

                      adapt




          Bundle       Bundle     Bundle
        Requirement   Revision   Capability



                      Bundle
                      Wiring
Bundle Wiring API

                      Bundle

                      adapt




          Bundle       Bundle     Bundle
        Requirement   Revision   Capability



                      Bundle
                      Wiring



                      Bundle
                       Wire
Bundle Wiring API

                                  Bundle
                      Bundle
                                 Revisions
                      adapt




          Bundle       Bundle     Bundle
        Requirement   Revision   Capability



                      Bundle
                      Wiring



                      Bundle
                       Wire
Updating a Bundle




       Bundle
      Revision




                    Bundle
                    (host)
Updating a Bundle




       Bundle                      Bundle
      Revision                    Revision




                    Bundle     Bundle
                    (host)   (fragment)
Updating a Bundle




       Bundle       Bundle     Bundle   Bundle         Bundle
      Revision      Wiring      Wire    Wiring        Revision




                      Bundle                       Bundle
                      (host)                     (fragment)
Updating a Bundle




                   Current


         Bundle              Bundle     Bundle   Bundle         Bundle
        Revision             Wiring      Wire    Wiring        Revision




    Bundle                     Bundle                       Bundle
   Revisions                   (host)                     (fragment)
Updating a Bundle

                     In
                    Use

         Bundle              Bundle
        Revision             Wiring
                                        Bundle
                                         Wire
                   Current


         Bundle              Bundle     Bundle   Bundle         Bundle
        Revision             Wiring      Wire    Wiring        Revision




    Bundle                     Bundle                       Bundle
   Revisions                   (host)                     (fragment)
Framework Wiring

• System Bundle can be
  adapted to control framework
  wide actions
                                 Framework
   • refresh                       Wiring


   • resolve                     adapt




                                   System
   • dependency closure            Bundle
StartLevel API

• Bundle Start Level controls
  start level information for an
  individual bundle                  Bundle
                                   Start Level

   • get/set bundle start level
                                   adapt




                                     Bundle
StartLevel API

• Bundle Start Level controls
  start level information for an
  individual bundle                   Bundle      Framework
                                    Start Level   Start Level

   • get/set bundle start level
                                    adapt         adapt



• Framework Start Level                             System
  controls framework wide start       Bundle
                                                    Bundle
  level information


   • get/set framework start
     level


   • get/set initial bundle start
Bytecode Weaving

• Very popular in enterprise
  applications


• Need an OSGi standard way to
  allow weaving classes when
  loading


• Introducing the WeavingHook
  service
Weaving Hook

• WeavingHook is passed a
  WovenClass object

                                          Weaver
• WovenClass allows weaver to


   • Mutate class file bytes    Weaving Hooks
                                                     Woven
                                                     Class
   • Add dynamic package
     import
                                         Framework

• Weaving Hooks called in
  ranking order
Composite Bundles

• Remember the session on
  Composite Bundles from last
  year?
Composite Bundles

• Remember the session on
  Composite Bundles from last
  year?


• Or the year before?
Composite Bundles

• Remember the session on
  Composite Bundles from last
  year?


• Or the year before?


• Well, if you did attend those
  sessions, you can forget what
  you heard
Composite Bundles

• Remember the session on
  Composite Bundles from last
  year?


• Or the year before?


• Well, if you did attend those
  sessions, you can forget what
  you heard


• Replaced by Resolver Hooks
Resolver Hook

• Replaces nested frameworks and composite bundles proposals


• Allows influence over resolver’s decisions


   • Hook can prevent a requirement from matching a capability


• Primary use case is scoping groups of bundles


   • But can be used for other purposes


• Provide primitives to build different scoping models
Resolver Hook

• Visitor pattern


• Resolver Hook Factory called
  to make a Resolver Hook                            Resolver
                                                    Hook Impl

   • Resolver Hook used for one
     resolve operation                                          Resolver
                                  Resolver Hook Factory
                                                                 Hook
• Resolver Hook removes
  candidates to constrain the
  resolve solution                                 Framework


• Resolver Hooks called in
  ranking order
Bundle Hooks

• Resolver Hooks alone are not
  enough to implement a bundle
  scoping solution


• Also need to be able to “hide”
  bundles outside a group from
  bundles “inside” a group


• Like Service Hooks for
  services, Bundle Hooks allow
  this for bundles
Find Hook and Event
Hook

• Find Hook can hide bundles
  from BundleContext
  getBundle(long) and
  getBundles() methods                 Bundle Hook
                                           Impl

• Event Hook can hide bundle
  events from registered
                               Find Hook               Event Hook
  BundleListener and
  SynchronousBundleListener
  objects
                                           Framework
BSN/Version Pair

• In 4.2, there could only be one
  bundle installed with a given
  Bundle-SymbolicName and
  Bundle-Version pair


   • Implicit singleton


• With scoping via Resolver
  Hooks and Bundle Hooks


   • We can allow this invariant
     to be broken
Launching Property

• Launching framework with the
 org.osgi.framework.bsnversion
 property set to multiple


   • Will allow the invariant to be
     broken


   • Scoping systems will need to
     properly handle


• By default, or with the property set
  to single, the invariant is held
Service EventListener Hook

• Replaces the Service Event Hook


• Allows finer control over event delivery


• Hook now has access to ListenerInfo for each listener which can receive
  the service event
A designer knows he has
achieved perfection not
when there is nothing left to
add, but when there is
nothing left to take away.
- Antoine de Saint-Exupéry
Next Releases

• Residential 4.3 - Summer 2011

    • TR069 support via DMTAdmin enhancements


    • Residential DM Tree

• Compendium 4.3 - Fall 2011


    • Updates to some Compendium services

    • Some new Compendium Services


• Enterprise 4.3 - 2012


    • Subsystems

    • OBR
OSGi 4.3 Technical Update: What's New in Generics, Capabilities and Requirements
OSGi 4.3 Technical Update: What's New in Generics, Capabilities and Requirements

Mais conteúdo relacionado

Mais procurados

Maximise the Power of OSGi - Carsten Ziegeler & David Bosschaert
Maximise the Power of OSGi - Carsten Ziegeler & David BosschaertMaximise the Power of OSGi - Carsten Ziegeler & David Bosschaert
Maximise the Power of OSGi - Carsten Ziegeler & David Bosschaertmfrancis
 
CDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily JiangCDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily Jiangmfrancis
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegelermfrancis
 
Aci programmability
Aci programmabilityAci programmability
Aci programmabilityCisco DevNet
 
Best Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseBest Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseChristopher Jones
 
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Make easier Integration of your services with Fuse Solutions - RedHat 2013Make easier Integration of your services with Fuse Solutions - RedHat 2013
Make easier Integration of your services with Fuse Solutions - RedHat 2013Charles Moulliard
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RSArun Gupta
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...Fermin Galan
 
Http programming in play
Http programming in playHttp programming in play
Http programming in playKnoldus Inc.
 
spray: REST on Akka
spray: REST on Akkaspray: REST on Akka
spray: REST on Akkasirthias
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache CamelKenneth Peeples
 
What is the ServiceStack?
What is the ServiceStack?What is the ServiceStack?
What is the ServiceStack?Demis Bellot
 
AWS Observability Made Simple
AWS Observability Made SimpleAWS Observability Made Simple
AWS Observability Made SimpleLuciano Mammino
 
IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation khawkwf
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gMarcelo Ochoa
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)sirthias
 
Adobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job ProcessingAdobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job ProcessingCarsten Ziegeler
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache CamelChristian Posta
 

Mais procurados (20)

Maximise the Power of OSGi - Carsten Ziegeler & David Bosschaert
Maximise the Power of OSGi - Carsten Ziegeler & David BosschaertMaximise the Power of OSGi - Carsten Ziegeler & David Bosschaert
Maximise the Power of OSGi - Carsten Ziegeler & David Bosschaert
 
CDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily JiangCDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily Jiang
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
 
Aci programmability
Aci programmabilityAci programmability
Aci programmability
 
Best Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseBest Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle Database
 
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Make easier Integration of your services with Fuse Solutions - RedHat 2013Make easier Integration of your services with Fuse Solutions - RedHat 2013
Make easier Integration of your services with Fuse Solutions - RedHat 2013
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RS
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
 
Http programming in play
Http programming in playHttp programming in play
Http programming in play
 
spray: REST on Akka
spray: REST on Akkaspray: REST on Akka
spray: REST on Akka
 
RESTing with JAX-RS
RESTing with JAX-RSRESTing with JAX-RS
RESTing with JAX-RS
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
 
CBDW2014 - Railo 5.0 and Beyond
CBDW2014 - Railo 5.0 and BeyondCBDW2014 - Railo 5.0 and Beyond
CBDW2014 - Railo 5.0 and Beyond
 
What is the ServiceStack?
What is the ServiceStack?What is the ServiceStack?
What is the ServiceStack?
 
AWS Observability Made Simple
AWS Observability Made SimpleAWS Observability Made Simple
AWS Observability Made Simple
 
IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)
 
Adobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job ProcessingAdobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job Processing
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache Camel
 

Destaque

Services-First Migration to OSGi
Services-First Migration to OSGiServices-First Migration to OSGi
Services-First Migration to OSGibjhargrave
 
OSGi for Enterprises
OSGi for EnterprisesOSGi for Enterprises
OSGi for Enterprisesmfrancis
 
Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...bjhargrave
 
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Avoid the chaos - Handling 100+ OSGi Components - Balázs ZsoldosAvoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldosmfrancis
 
Hands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanHands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanJulien Vermillard
 

Destaque (7)

Services-First Migration to OSGi
Services-First Migration to OSGiServices-First Migration to OSGi
Services-First Migration to OSGi
 
OSGi for Enterprises
OSGi for EnterprisesOSGi for Enterprises
OSGi for Enterprises
 
Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
 
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Avoid the chaos - Handling 100+ OSGi Components - Balázs ZsoldosAvoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
 
Hands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanHands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse Leshan
 
OSGi Puzzlers
OSGi PuzzlersOSGi Puzzlers
OSGi Puzzlers
 

Semelhante a OSGi 4.3 Technical Update: What's New in Generics, Capabilities and Requirements

OSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerOSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerSkills Matter
 
Spring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingSpring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingThorsten Kamann
 
AngularJS Unit Testing
AngularJS Unit TestingAngularJS Unit Testing
AngularJS Unit TestingPrince Norin
 
Ember Data and Custom APIs
Ember Data and Custom APIsEmber Data and Custom APIs
Ember Data and Custom APIsDavid Tang
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An IntroductionThorsten Kamann
 
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123Parag Gajbhiye
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastMichelangelo van Dam
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitMike Pfaff
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
AngularJS Tips&Tricks
AngularJS Tips&TricksAngularJS Tips&Tricks
AngularJS Tips&TricksPetr Bela
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaAtlassian
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述fangjiafu
 

Semelhante a OSGi 4.3 Technical Update: What's New in Generics, Capabilities and Requirements (20)

OSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerOSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle Manager
 
Spring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingSpring 3 - Der dritte Frühling
Spring 3 - Der dritte Frühling
 
AngularJS Unit Testing
AngularJS Unit TestingAngularJS Unit Testing
AngularJS Unit Testing
 
Ember Data and Custom APIs
Ember Data and Custom APIsEmber Data and Custom APIs
Ember Data and Custom APIs
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An Introduction
 
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and Profit
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
AngularJS Tips&Tricks
AngularJS Tips&TricksAngularJS Tips&Tricks
AngularJS Tips&Tricks
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure Java
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Scala and Spring
Scala and SpringScala and Spring
Scala and Spring
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
Elegant APIs
Elegant APIsElegant APIs
Elegant APIs
 
Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述
 
Java 7 New Features
Java 7 New FeaturesJava 7 New Features
Java 7 New Features
 

Último

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

OSGi 4.3 Technical Update: What's New in Generics, Capabilities and Requirements

  • 1. OSGi 4.3 Technical Update: What's New? BJ Hargrave, IBM
  • 2. Generics • Framework API feels “old- fashioned” • Lack of generics • Uses of arrays and null return • Generics have been held back because the embedded world is still still based upon Java 1.4
  • 3. -target jsr14 • Developed to compile Java 5 code for 1.4 JREs
  • 4. -target jsr14 • Developed to compile Java 5 code for 1.4 JREs • All compilers recognize the • -source 1.5 -target jsr14 switches
  • 5. -target jsr14 • Developed to compile Java 5 code for 1.4 JREs • All compilers recognize the • -source 1.5 -target jsr14 switches • Output class format 48 (1.4) • Stores generics in skippable attributes • Avoids Java 5 introduced types/members
  • 6. -target jsr14 • Developed to compile Java 5 code for 1.4 JREs • All compilers recognize the • -source 1.5 -target jsr14 switches • Output class format 48 (1.4) • Stores generics in skippable attributes • Avoids Java 5 introduced types/members • Works like a charm, but … • No annotations • No enums
  • 7. Framework & ServiceTracker “generified” ServiceReference<S> getServiceReference(Class<S>); Collection<ServiceReference<S>> getServiceReferences( Class<S>, …); ServiceRegistration<S> registerService(Class<S>, …) new ServiceTracker<S,T>(context, Class<S>, null);
  • 8. Type Safe use of Services ServiceReference lr = context.getServiceReference(LogService.class.getName()); LogService log = (LogService)context.getService(lr); becomes ServiceReference<LogService> lr = context.getServiceReference(LogService.class); LogService log = context.getService(lr);
  • 9. Type Safe use of Services ServiceReference[] rs = context.getServiceReferences(EventAdmin.class.getName(), …); becomes Collection<ServiceReference<EventAdmin>> rs = context.getServiceReferences(EventAdmin.class, …); There can be some source incompatibilities since using null for the service type argument is now ambiguous.
  • 10. Type Safe use of Services ServiceRegistration sr = context.registerService( ConfigurationListener.class.getName(), …) becomes ServiceRegistration<ConfigurationListener> sr = context.registerService(ConfigurationListener.class, …)
  • 11. Type Safe use of Services ServiceTracker st = new ServiceTracker( context, EventListener.class, null); st.open(); EventListener el = (EventListener)st.getService(); becomes ServiceTracker<EventListener,EventListener> st = new ServiceTracker<EventListener,EventListener>( context, EventListener.class, null); st.open(); EventListener el = st.getService();
  • 12. Capabilities • A capability is a set of attributes in a namespace
  • 13. Capabilities • A capability is a set of attributes in a namespace • Built-in capabilities • osgi.wiring.package: Export-Package • osgi.wiring.bundle: Bundle-SymbolicName • osgi.wiring.host: Bundle-SymbolicName
  • 14. Capabilities • A capability is a set of attributes in a namespace • Built-in capabilities • osgi.wiring.package: Export-Package • osgi.wiring.bundle: Bundle-SymbolicName • osgi.wiring.host: Bundle-SymbolicName • Generic capabilities: Provide-Capability manifest header
  • 15. Requirements • A requirement is a filter expression over the attribute set of a capability
  • 16. Requirements • A requirement is a filter expression over the attribute set of a capability • Built-in requirements • osgi.wiring.package: Import-Package • osgi.wiring.bundle: Require-Bundle • osgi.wiring.host: Fragment-Host
  • 17. Requirements • A requirement is a filter expression over the attribute set of a capability • Built-in requirements • osgi.wiring.package: Import-Package • osgi.wiring.bundle: Require-Bundle • osgi.wiring.host: Fragment-Host • Generic requirements: Require-Capability manifest header
  • 18. 7,*&4%.F','#"?;%#"7".*'*)','&,(,:%3%*15'D;./3"+'&,.').31'(#)$%/"'*4"%#'&,(,:%3%*%"+'94".'*4"%#' #"?;%#"7".*+',#"'+,*%+-%"/2'*4,*'%+2'#"?;%#"7".*+',#"'*#,.+%*%$"5' G4"'H"?;%#"@E,(,:%3%*1',./'I#)$%/"@E,(,:%3%*1'4",/"#+',#"'7,.%-"+*'4",/"#+'*4,*''&-0"(&'F"."#%&' #"?;%#"7".*+',./'&,(,:%3%*%"+'%.',.1'.,7"'+(,&"5'J)9"$"#2','.;7:"#')-'7,.%-"+*'4",/"#+'%.'*4"' C!K%'+("&%-%&,*%).+',#"',&*;,331'#"?;%#"7".*+').'&,(,:%3%*%"+'+("&%-%"/':1')*4"#'C!K%'7,.%-"+*'4",/@ Capabilities and Requirements "#+5'=)#'"<,7(3"2',.'67()#*@I,&0,F"'&3,;+"'%+','#"?;%#"7".*').'*4"'&,(,:%3%*1'+("&%-%"/':1'*4"'L<()#*@ I,&0,F"'&3,;+"5'G4%+'+("&%-%&,*%).'*4"#"-)#"'&).*,%.+','.;7:"#')-'.,7"'+(,&"+'-)#'*4"+"'C!K%'7,.%@ -"+*'4",/"#+M'+1&$23$#$%&245%6,-2'+1&$23$#$%&278.98&-2',./'+1&$23$#$%&2:+1"5'G4"+"'.,7"'+(,&"+' %.-3;".&"'*4"'#"+)3$"#',./'/"-%."'*4"'&3,++'3),/%.F'(#)&"++5'=)#'"<,7(3"2','H"?;%#"@D;./3"'&3,;+"'%+',' • Additional resolver constraint #"?;%#"7".*'*4,*'".+;#"+'*4,*'*4"'"<()#*"/'(,&0,F"+')-'*4"'#"?;%#"/':;./3"',#"',$,%3,:3"'*)'*4"' #"?;%#"#N+'&3,++'3),/"#5 H"?;%#"7".*+',./'E,(,:%3%*%"+',#"''&-0"(&''%.',':;./3"5'G4"'C!K%'-#,7"9)#0'&,.'*4".'7,*&4'*4"' #"?;%#"7".*+'*)'&,(,:%3%*%"+')-')*4"#':;./3"+'%.'*4"'(&!304$,5'(4,+"5'>':;./3"'&,.').31'#;.'94".'%*'%+' • Each non-optional requirement must be satisfied by a capability #"+)3$"/',./'*4"#"-)#"'%*+'/"("./".&%"+',#"'+,*%+-%"/5'G4"'#"+)3$"#'&#",*"+'6$(&!':"*9"".'*4"'#"?;%#"@ 7".*+',./'&,(,:%3%*%"+O'*4"'/"&3,#%.F':;./3"'%+'.)*',39,1+'*4"'+,7"',+'*4"'4)+*%.F':;./3"5'G4"'#"+)3$@ %.F'(#)&"++'%+'/"+&#%:"/'%.'7&!304$,518(3-&!!').'(,F" PQ5'G4"'/%,F#,77%.F'*"&4.%?;"')-'*4"' • Visible in the wiring of the bundles H"?;%#"7".*RE,(,:%3%*1'7)/"3'%+'/"(%&*"/'%.'=%F;#"'S5T2'*4"'/"*,%3+')-'*4"'9%#%.F',#"'-;#*4"#' "<(3,%."/'%.'9*,'0&1:$($,51;8<1=.&-$%$-"#$3,').'(,F" QSU5 >$5*(&1?@A 7&)*$(&+&,#!1",'1B"."/$0$#$&!1",'1#C&$(1:$($,5 <-=5$#->-%" *8784$,$"; A5%6,- <-=5$#->-%"?*8784$,$"; :+1" @#8&>-%" <5%"$>- !"!"+ ,-./%0$12*$13.*$
  • 19. osgi.ee Capabilities and Requirements • Replacement for org.osgi.framework.executionenvironment and Bundle-RequiredExecutionEnvironment
  • 20. osgi.ee Capabilities and Requirements • Replacement for org.osgi.framework.executionenvironment and Bundle-RequiredExecutionEnvironment • Provide-Capability: osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4,1.5,1.6"
  • 21. osgi.ee Capabilities and Requirements • Replacement for org.osgi.framework.executionenvironment and Bundle-RequiredExecutionEnvironment • Provide-Capability: osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4,1.5,1.6" • Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE) (version>=1.6))"
  • 22. adapt • Replacing Framework services • Bundle was almost always parameter, not very OO
  • 23. adapt • Replacing Framework services • Bundle was almost always parameter, not very OO • The Bundle.adapt method adapts a Bundle object to another type (if supported) • <A> A adapt( Class<A> type ) <A>
  • 24. adapt • Replacing Framework services • Bundle was almost always parameter, not very OO • The Bundle.adapt method adapts a Bundle object to another type (if supported) • <A> A adapt( Class<A> type ) <A> • Returned objects match the life cycle of the adapted bundle.
  • 25. Replacements • PackageAdmin service Bundle Wiring API • BundleWiring wiring = bundle.adapt(BundleWiring.class) <A>
  • 26. Replacements • PackageAdmin service Bundle Wiring API • BundleWiring wiring = bundle.adapt(BundleWiring.class) • StartLevel service Start Level API • BundleStartLevel bsl = <A> bundle.adapt(BundleStartLevel.class)
  • 27. Replacements • PackageAdmin service Bundle Wiring API • BundleWiring wiring = bundle.adapt(BundleWiring.class) • StartLevel service Start Level API • BundleStartLevel bsl = <A> bundle.adapt(BundleStartLevel.class) • PackageAdmin and StartLevel are not in Core 4.3 spec but frameworks will still implement them
  • 29. Bundle Wiring API Bundle adapt Bundle Revision
  • 30. Bundle Wiring API Bundle adapt Bundle Bundle Bundle Requirement Revision Capability
  • 31. Bundle Wiring API Bundle adapt Bundle Bundle Bundle Requirement Revision Capability Bundle Wiring
  • 32. Bundle Wiring API Bundle adapt Bundle Bundle Bundle Requirement Revision Capability Bundle Wiring Bundle Wire
  • 33. Bundle Wiring API Bundle Bundle Revisions adapt Bundle Bundle Bundle Requirement Revision Capability Bundle Wiring Bundle Wire
  • 34. Updating a Bundle Bundle Revision Bundle (host)
  • 35. Updating a Bundle Bundle Bundle Revision Revision Bundle Bundle (host) (fragment)
  • 36. Updating a Bundle Bundle Bundle Bundle Bundle Bundle Revision Wiring Wire Wiring Revision Bundle Bundle (host) (fragment)
  • 37. Updating a Bundle Current Bundle Bundle Bundle Bundle Bundle Revision Wiring Wire Wiring Revision Bundle Bundle Bundle Revisions (host) (fragment)
  • 38. Updating a Bundle In Use Bundle Bundle Revision Wiring Bundle Wire Current Bundle Bundle Bundle Bundle Bundle Revision Wiring Wire Wiring Revision Bundle Bundle Bundle Revisions (host) (fragment)
  • 39. Framework Wiring • System Bundle can be adapted to control framework wide actions Framework • refresh Wiring • resolve adapt System • dependency closure Bundle
  • 40. StartLevel API • Bundle Start Level controls start level information for an individual bundle Bundle Start Level • get/set bundle start level adapt Bundle
  • 41. StartLevel API • Bundle Start Level controls start level information for an individual bundle Bundle Framework Start Level Start Level • get/set bundle start level adapt adapt • Framework Start Level System controls framework wide start Bundle Bundle level information • get/set framework start level • get/set initial bundle start
  • 42. Bytecode Weaving • Very popular in enterprise applications • Need an OSGi standard way to allow weaving classes when loading • Introducing the WeavingHook service
  • 43. Weaving Hook • WeavingHook is passed a WovenClass object Weaver • WovenClass allows weaver to • Mutate class file bytes Weaving Hooks Woven Class • Add dynamic package import Framework • Weaving Hooks called in ranking order
  • 44. Composite Bundles • Remember the session on Composite Bundles from last year?
  • 45. Composite Bundles • Remember the session on Composite Bundles from last year? • Or the year before?
  • 46. Composite Bundles • Remember the session on Composite Bundles from last year? • Or the year before? • Well, if you did attend those sessions, you can forget what you heard
  • 47. Composite Bundles • Remember the session on Composite Bundles from last year? • Or the year before? • Well, if you did attend those sessions, you can forget what you heard • Replaced by Resolver Hooks
  • 48. Resolver Hook • Replaces nested frameworks and composite bundles proposals • Allows influence over resolver’s decisions • Hook can prevent a requirement from matching a capability • Primary use case is scoping groups of bundles • But can be used for other purposes • Provide primitives to build different scoping models
  • 49. Resolver Hook • Visitor pattern • Resolver Hook Factory called to make a Resolver Hook Resolver Hook Impl • Resolver Hook used for one resolve operation Resolver Resolver Hook Factory Hook • Resolver Hook removes candidates to constrain the resolve solution Framework • Resolver Hooks called in ranking order
  • 50. Bundle Hooks • Resolver Hooks alone are not enough to implement a bundle scoping solution • Also need to be able to “hide” bundles outside a group from bundles “inside” a group • Like Service Hooks for services, Bundle Hooks allow this for bundles
  • 51. Find Hook and Event Hook • Find Hook can hide bundles from BundleContext getBundle(long) and getBundles() methods Bundle Hook Impl • Event Hook can hide bundle events from registered Find Hook Event Hook BundleListener and SynchronousBundleListener objects Framework
  • 52. BSN/Version Pair • In 4.2, there could only be one bundle installed with a given Bundle-SymbolicName and Bundle-Version pair • Implicit singleton • With scoping via Resolver Hooks and Bundle Hooks • We can allow this invariant to be broken
  • 53. Launching Property • Launching framework with the org.osgi.framework.bsnversion property set to multiple • Will allow the invariant to be broken • Scoping systems will need to properly handle • By default, or with the property set to single, the invariant is held
  • 54. Service EventListener Hook • Replaces the Service Event Hook • Allows finer control over event delivery • Hook now has access to ListenerInfo for each listener which can receive the service event
  • 55. A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away. - Antoine de Saint-Exupéry
  • 56. Next Releases • Residential 4.3 - Summer 2011 • TR069 support via DMTAdmin enhancements • Residential DM Tree • Compendium 4.3 - Fall 2011 • Updates to some Compendium services • Some new Compendium Services • Enterprise 4.3 - 2012 • Subsystems • OBR

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n