SlideShare ist ein Scribd-Unternehmen logo
1 von 95
Downloaden Sie, um offline zu lesen
Become  a  Cer*fied  
 Bundle  Manager  
     today

   Karl  Pauls  &  Marcel  Offermans




                                      !"#$%&'&()"*
Karl  @  Akquinet


• Member  Apache  So8ware  Founda<on
 • PMC  Felix,  Sling,  Incubator
 • PPMC  Ace,  Clerezza
• So8ware  Architect  at  akquinet
• Co-­‐Author  „OSGi  in  Ac<on“
• karl.pauls@akquinet.de
Marcel  @  luminis

• Member  Apache  So8ware  Founda<on
 • CommiMer  and  PMC  member  at  
   Apache  Felix  and  Apache  ACE
• So8ware  architect  at  Luminis  Technologies
• Luminis:  group  of  companies,  strong  focus  on  
  technical  excellence,  offices  in  The  
  Netherlands  and  the  United  Kingdom
• marcel.offermans@luminis.nl
Requirements  for  exercises




• Computer  with  Java  6  pre-­‐installed
• Memory  s<ck  with  the  exercises
Agenda


• Quick  OSGi  recap
• Bundle  management
• Pax  Runner
• File  Install
• OBR
• Apache  ACE
OSGi:  core  +  compendium




       !"#$%"&'($)&%*+,-./'0    !"#$%"&'($)&%*+,-./'0
       1/'&%"2&)$.$),-$/3       "&'($)&%1/02&34$50
       45&%!"#$%6++$,3)&        67&%!"#$%8++$,3)&

       7&+&,8&%9:%;&'8$/3%9<=   9&+&,:&%;<%=&':$/3%;>?
       >?3&%=@@A                85@5:-%?AAB
Core

       !"#$%"&'($)&%*+,-./'0
       1/'&%"2&)$.$),-$/3
       45&%!"#$%6++$,3)&

       7&+&,8&%9:%;&'8$/3%9<=
       >?3&%=@@A
Framework


      ;/2:($   ;/2:($   ;/2:($
                                        4$-+"&$
                                      !"#$%&'&($
                                       08:/($
                                       4$&/-".'
                                 345"%#-*6$78-9
                            )*+*%,"-./*(%0*&1"2$
-$?8(+$:                                       *&C+$

Framework
 $2: /2"2?.*((                        ?.8=="2<       ?.8=

               /2"2?.*(($:




    ;/2:($            ;/2:($         ;/2:($        ;/2:($     08:/($

            "6=8-.?                           "6=8-.?
                               $@=8-.?
  $@=8-.?                  $@=8-.?                          $@=8-.?
  8-<B*=*&1$B/C(%DBE           8-<B*=*&1$B:>%DBH

                 8-<B*=*&1$B(8<%FBG              8-<B*=*&1$B/C(%DBD
=/>("?1         /?$                               /?$
Framework
    ;/2:($                       ;/2:($           ;/2:($         ;/2:($




        "2?.*((                                                      !"#$%&'&($
                       "2?.*(($:
?.*-.                                  ?.*-.     ?.*-C2<

                       -$?8(+$:                                       *&C+$

 $2:              /2"2?.*((                     ?.8=="2<     ?.8=

                      /2"2?.*(($:




        ;/2:($                ;/2:($           ;/2:($       ;/2:($    08:/($
Framework


                                                          4$-+"&$
        !8<                4.8-$             A-$#?
                                   =/>("?1            =/>("?1
   =/>("?1                  /?$
                /?$                          /?$

      ;/2:($          ;/2:($       ;/2:($            ;/2:($




  "2?.*((                                              !"#$%&'&($
               "2?.*(($:
Compendium

             !"#$%"&'($)&%*+,-./'0
             "&'($)&%1/02&34$50
             67&%!"#$%8++$,3)&

             9&+&,:&%;<%=&':$/3%;>?
             85@5:-%?AAB
OSGi  compendium

    User Admin          Initial Provisioning        Wire Admin
              Blueprint Container          Device Access
XML Parser
                         Measurement and State
             Preferences
                                                    UPnP™ Device
                  Log        Configuration Admin
    Position
               Remote Services
                             Service Tracker
 Event Admin                                         !"#$%"&'($)&%*+,-./'0
                                                     "&'($)&%1/02&34$50

                              HTTP
                                                     67&%!"#$%8++$,3)&


     Deployment Admin                                9&+&,:&%;<%=&':$/3%;>?
                                                     85@5:-%?AAB




IO Connector         Execution Environment Spec
       Declarative Services          Metatype
Define  Modules  ...
...  Compose  Modules  ...
...  with  OSGi


    !"#$%&"
                  • L3  -­‐  Provides  a  publish/find/bind  
                    service  model  to  decouple  bundles
                  • L2  -­‐  Manages  the  lifecycle  of  bundle  in  
   +%,"-&.&+"       a  bundle  repository  without  requiring  
                    the  VM  be  restarted
                  • L1  -­‐  Creates  the  concept  of  bundles  
                    that  use  classes  from  each  other  in  a  
    '()*+"          controlled  way  according  to  constraints
Experience:  oHen,  it’s  not  OSGi

• Real  world  applica<ons  run  on
 • an  opera<ng  system,  inside  a  virtual  machine
• and  have:
 • databases
 • non-­‐OSGi  clients
 • other  (na<ve)  files  /  data
• For  the  BEST  experience,  make  everything  
  deployable
Modularity
• What?
 • Separa<on  of  concerns
 • Structure
 • Encapsula<on
 • Focuses  on
   • Cohesion  (low  is  bad,  high  is  good)

   • Coupling  (low  is  good,  high  is  bad)

• Why?
 • Independent  development
 • Independent  maintenance
 • Improve  reusability
OSGi  Bundle


• A  bundle  is  a  module  in  OSGi  terminology
• A  bundle  is  a  JAR  file  containing
 • Code
 • Resources                                )*+"''
                                              )*+"''
                                                )*+"''

 • Metadata               ),!+-.)/0&1
                            ),!+-.)/0&1
                              ),!+-.)/0&1
                              -.&(*)                     !"#$%&
                                -.&(*)
                                  -.&(*)



                                             !"#$%&'(
Bundle  Metadata



• Bundle  metadata  captures
 • Human-­‐readable  informa<on
 • Bundle  iden<fica<on
 • Code  visibility
• Stored  in  the  JAR  manifest  as  proper<es
Version  Format
• OSGi  uses  a  4-­‐part  version  numbering  scheme
 • <major>.<minor>.<micro>.<qualifier>
 • Major,  minor,  and  micro  are  numeric  values
 • Qualifier  is  a  string  value
 • Valid  examples
   • 1,  1.10,  1.9.9.alpha,  0.2.0.SNAPSHOT
 • Invalid  examples
   • 0.2.SNAPSHOT,  1.9.9-­‐alpha
 • Comparison  (not  always  intui<ve)
   • 1.0.0  <  1.9.9  <  1.10
   • 1.0.0.beta  >  1.0.0.alpha  >  1.0.0
Version  Range  Format
• Interval  nota<on  is  used  for  version  ranges
 • Use  '['  or  ']'  for  inclusive  values
 • Use  '('  or  ')'  for  exclusive  values
 • Example  (quotes  needed)
   • "[1.0.0,2.0.0)"  ==  (1.0.0  <=  v  <  2.0.0)
 • When  a  version  range  is  expected,  a  single  value  
   represents  an  infinite  range
   • "1.0.0"  ==  (1.0.0  <=  v  <  ∞)
 • To  specify  a  precise  version
   • "[1.0.0,1.0.0]"
Experience:  versioning

• Choose  a  versioning  policy  and  s<ck  with  it
• Version  all  packages  you  export
• Use  version  ranges  on  import  that  are  
  consistent  with  policy
• If  you  FORGET  this  you  will  REGRET  it
• Do  not  be  tempted  to  mis-­‐use  commercial  
  versions  internally
• Only  bump  versions  on  actual  changes
Version  Policy

• Major  number  change  –  signifies  an  incompa<ble  
  update.  
• Minor  number  change  –  signifies  a  backward  
  compa<ble  update.  
• Micro  number  change  –  signifies  an  internal  update  
  (e.g.,  a  bug  fix  or  performance  improvement).  
• Qualifier  change  –  signifies  a  trivial  internal  change  
  with  “outward”  no<ceable  difference,  but  
  nonetheless  is  a  new  ar<fact  (e.g.,  line  number  
  refactoring).  
Tip:  Seman*c  Versioning  whitepaper


                               Semantic Versioning
                                                        Technical Whitepaper



                                                                   Revision 1.0
                                                                   May 6, 2010




                                © 2010 OSGi Alliance
                                 All Rights Reserved.




Source:  h*p://www.osgi.org/wiki/uploads/Links/Seman9cVersioning.pdf
Exposing  Internal  Code

                                                           !


• Expor<ng  a  versioned  package
 • Export-­‐Package:  javax.servlet;  version="2.4.0"
• Can  also  specify  arbitrary  matching  aMributes
 • Export-­‐Package:  javax.servlet;  javax.servlet.hMp;
     version="2.4.0";  "vendor=ASF"
Downsides  and  Pialls


!!"#$%&'("))   !"#"      *++               !!"#$%&'("))   !"#"     *++
                       ,&(-./01                                  ,&(-./01
                                                                 5&(-./01




                                  !&*+)#
                $%&'#%#()"                                $%&'#%#()"
                       *++234$                                   *++234$
Best  Prac*ce


      !!"#$%&'("))     !"#"        *++

                     *+,-./0,-1


                                       *+,-./+,+1

                          $%&'#%#()"
                                  *++,-.$
Impor*ng  &  Expor*ng  a  Package  (1/4)

• Imagine  bundle  A  somehow  gets  servlet  
  instances  from  bundle  B

                                 /,%&'(
                              )*+*,-./'+0/(
                                               "
                 #$%&'(                       -10*..
              )*+*,-./'+0/(
          !
                                                &2/31&%43&5
                                               )*+*,-./'+0/(
Impor*ng  &  Expor*ng  a  Package  (1/4)

• What  if  bundle  A  also  wanted  to  get  servlet  
  instances  somehow  from  bundle  C?

                                  /,%&'(
                               )*+*,-./'+0/(
                                                "
                  #$%&'(                       -10*..
               )*+*,-./'+0/(
           !
                                                 &2/31&%43&5
                                                )*+*,-./'+0/(
Impor*ng  &  Expor*ng  a  Package  (2/4)

• Bundle  C  could  import  from  bundle  B,  but  
  then  it  is  dependent  on  it
                    #$%&'(
                 )*+*,-./'+0/(
             6
                                    /,%&'(
                                 )*+*,-./'+0/(
                                                  "
                    #$%&'(                       -10*..
                 )*+*,-./'+0/(
             !
                                                   &2/31&%43&5
                                                  )*+*,-./'+0/(
Impor*ng  &  Expor*ng  a  Package  (3/4)

• Bundle  C  could  export  its  own  servlet  
  package,  but  bundle  A  could  only  see  either  C  
  or  B                     /,%&'(
                                )*+*,-./'+0/(
                                                 "
                                                -10*..
                   #$%&'(
                )*+*,-./'+0/(
            !                                      (2&31&%#/.3&4
                                666                )*+*,-./'+0/(


                                                 5
                                                -10*..
                                   /,%&'(
                                )*+*,-./'+0/(
Impor*ng  &  Expor*ng  a  Package  (4/4)

• Bundle  C  could  both  import  and  export  
  servlet  to  solve  the  dilemma
      /,%&'(1*231#$%&'(
        )*+*,-./'+0/(
             "
            -40*..                   /,%&'(1*231#$%&'(
                                       )*+*,-./'+0/(
                                            5
                        #$%&'(             -40*..
                     )*+*,-./'+0/(
             !
Advanced  Consistency  Checking

• Some<mes  more  advanced  consistency  
  checking  is  necessary,  consider  this
  Interface
  package org.foo.http;
  import javax.servlet;
  public interface HttpService {
    void registerServlet(Sting alias, Servlet servlet);
  }

  Metadata
  Export-Package: org.foo.http; version="1.0.0"
  Import-Package: javax.servlet; version="2.3.0"
Advanced  Consistency  Checking

• Some<mes  more  advanced  consistency  
  checking  is  necessary,  consider  this


                                               ),-.'/          &2-.'/
                           &2-.'/           01(123%&'(4&/   01(123%&'(4&/
                        .':3;..3<=-         (&'%).5673839   (&'%).5673839

                                       !""#$                                +
                                      %&'()*&
Advanced  Consistency  Checking

• Some<mes  more  advanced  consistency  
  checking  is  necessary,  consider  this


           ),-.'/                                                     ),-.'/          &2-.'/
        01(123%&'(4&/              ),-.'/         &2-.'/           01(123%&'(4&/   01(123%&'(4&/
        (&'%).5673>39            .':3;..3<=-   .':3;..3<=-         (&'%).5673839   (&'%).5673839

                        !""#$                                 !""#$                                +
                        *4)&5/                               %&'()*&
Advanced  Consistency  Checking

    • Some<mes  more  advanced  consistency  
      checking  is  necessary,  consider  this


       &,-.'/                                           &,-.'/
    01(1,2%&'(3&/               &,-.'/               01(1,2%&'(3&/
    (&'%).4562>28            .'92:..2;<-             (&'%).4562728

=                   !""#$                   !""#$                    +
                    *3)&4/                 %&'()*&
Advanced  Consistency  Checking

    • Some<mes  more  advanced  consistency  
      checking  is  necessary,  consider  this


       &,-.'/                                                           &,-.'/
    01(1,2%&'(3&/                               &,-.'/               01(1,2%&'(3&/
    (&'%).4562>28                            .'92:..2;<-             (&'%).4562728

=                   !""#$                                   !""#$                    +
                    *3)&4/                                 %&'()*&



                             This  would  result  in  a
                              ClassCastExcep<on,
                                     why?
Advanced  Consistency  Checking

    • Some<mes  more  advanced  consistency  
      checking  is  necessary,  consider  this


       &,-.'/                                           &,-.'/
    01(1,2%&'(3&/               &,-.'/               01(1,2%&'(3&/
    (&'%).4562>28            .'92:..2;<-             (&'%).4562728

=                   !""#$                   !""#$                    +
                    *3)&4/                 %&'()*&
Advanced  Consistency  Checking

    • Some<mes  more  advanced  consistency  
      checking  is  necessary,  consider  this
                                We  need  to  declare  such
                                internal  dependencies!
       &,-.'/                                                              &,-.'/
    01(1,2%&'(3&/                                  &,-.'/               01(1,2%&'(3&/
    (&'%).4562>28                               .'92:..2;<-             (&'%).4562728

=                          !""#$                               !""#$                    +
                           *3)&4/                             %&'()*&
                                                              ?@%&%?


                                       Metadata
                    Export-Package: org.foo.http; version="1.0.0";
                              uses:="javax.servlet"
                    Import-Package: javax.servlet; version="2.3.0"
Run-­‐Time  Bundle  Iden*fica*on

• Bundle  symbolic  name  plus  bundle  version
 • Assigned  in  the  bundle  metadata
• Install  loca<on
 • Assigned  when  installing  bundle
 • Typically  the  URL  from  which  the  bundle  is  retrieved
• Bundle  iden<fier
 • Assigned  by  the  framework
 • A  long  value  which  increases  for  each  installed  
   bundled
Framework  Bundle  Cache
• The  framework  maintains  a  bundle  cache
 • Installing  a  bundle  saves  it  to  the  cache
 • Once  installed,  the  original  bundle  JAR  file  is  no  longer  needed
 • Subsequent  framework  execu<ons  will  reload  the  cached  bundles
• The  framework  also  saves  the  bundle  state  in  the  
  bundle  cache
 • When  a  bundle  is  started,  it  is  persistently  recorded  as  being  
   ac<ve
 • Ac<ve  bundles  will  be  restarted  in  subsequent  framework  
   execu<ons
• Upda<ng  and  uninstalling  bundles  also  impact  the  
  cache,  but  it  is  a  liMle  more  complicated
Package  Admin

• Framework  provides  special  API  for  this  
  purpose
  public interface PackageAdmin {
    static final int BUNDLE_TYPE_FRAGMENT = 0x00000001;
    Bundle getBundle(Class clazz);
    Bundle[] getBundles(String symbolicName, String versionRange);
    int getBundleType(Bundle bundle);
    ExportedPackage getExportedPackage(String name);
    ExportedPackage[] getExportedPackages(Bundle bundle);
    ExportedPackage[] getExportedPackages(String name);
    Bundle[] getFragments(Bundle bundle);
    RequiredBundle[] getRequiredBundles(String symbolicName);
    Bundle[] getHosts(Bundle bundle);
    void refreshPackages(Bundle[] bundles);
    boolean resolveBundles(Bundle[] bundles);
  }
Paint  Program  Design  (1/2)

 • Rela<onship  between  classes
   !"#$%&                        9%:#53.&
  '(#)*%(                        !"#$%




+#,-.&/(#0%                 !,0$3%&!"#$%




  !"#$%&
              1,()3%    !45#(%              '(,#-63%   '(#$%72,8
120$2-%-.
Paint  Program  Design  (2/2)


                  1#,23)

                                 )*(+,%
                             +,-./++.0'"()
                  &45",)

 !"#$%                                       &'"()

                 6,#"$-3)



                 6,"()7+#8
Demo
Experience:  Swing


• First  of  all,  how  do  you  modularize  a  UI?
• Second,  how  dynamic  do  you  want  it  to  be?
• Third:  dealing  with  already  instan<ated  stuff  
  (panels,  look  and  feel,  ...)
• For  more  info:
  hMp://lsd.luminis.nl/swing-­‐and-­‐osgi
Pax  Runner



• Hosted  at  OPS4J
• Bootstrapper  for  OSGi  frameworks
• ini<al  provisioning  of  bundles
• great  tool  for  developers
Pax  Runner


• Unzip  the  archive,  add  to  path
• selec<ng  the  framework
• op<ons,  op<ons,  op<ons
• profiles  and  ini<al  provisioning
• crea<ng  a  distribu<on
Pax  Runner  -­‐  Frameworks


• Run  the  default  framework:
  pax-­‐run.sh
• Run  Equinox  version  3.5.1:
  pax-­‐run.sh  -­‐-­‐playorm=equinox  -­‐-­‐version=3.5.1
• Run  with  a  pre-­‐defined  profile:
  pax-­‐run.sh  -­‐-­‐profiles=felix.webconsole
Pax  Runner  -­‐  Windows  FAQ


        009.  I'm  using  Pax  Runner  on  DOS/Windows,  I  have  the  right  
        command  but  I'm  ge{ng  strange  errors
        DOS/Windows  shell  seems  to  strip  the  equals  (=)  from  the  
        command  line  and  treats  the  leD  and  right  side  of  the  equals  as  
        separate  arguments  for  the  batch  file.  Thus,  the  arguments  to  
        the  java  executable  for  an  argument  like  (for  example)  -­‐-­‐
        profiles=log  will  be  split  in  two  arguments  as  -­‐-­‐profiles  and  log.  
        To  avoid  this  you  will  have  to  enclose  the  en9re  argument  
        between  quotes  (")  as  in  "-­‐-­‐profiles=log".



Source:  h*p://paxrunner.ops4j.org/display/paxrunner/FAQ
Pax  Runner  -­‐  Provisioning

• Provisioning  your  own  bundles:
 • Create  a  text  file  with  the  bundle  URLs  (called  
   “profile”):
   file:paint/servicebased.host-­‐1.0.0.jar
   file:paint/servicebased.circle-­‐1.0.0.jar
 • Point  to  the  file  when  launching:
   pax-­‐run.sh  -­‐-­‐args=file:profile
• Provisioning  all  bundles  in  a  directory:
  pax-­‐run.sh  mybundledir/
Pax  Runner  -­‐  Crea*ng  scripts


• Crea<ng  a  script  to  launch  a  framework  
  without  Pax  Runner:
  pax-­‐run.sh  -­‐-­‐executor=script  
          -­‐-­‐workingDirectory=.
• Create  an  archive  containing  everything  you  
  need  to  run:
  pax-­‐run.sh  -­‐-­‐executor=zip  
          -­‐-­‐profiles=felix.webconsole,compendium
Excercises


• Launch  Pax  Runner  with  different  fw’s
• Launch  a  profile  (felix.webconsole)
  hMp://localhost:8080/system/console  
  and  log  in  as  admin/admin
• Create  a  profile  for  the  Paint  Program
• Add  webconsole  (for  monitoring)
• Create  a  distributable  ZIP  file  with  Pax  Runner
Experience:  Pax  Runner


• great  for  development
• nicely  integrates  into  build  environment
• base  for  Pax  Exam  (tes<ng  framework)
• don’t  ship  to  customers  (needs  online  
  connec<on,  usually  you  don’t  want  that  much  
  freedom)
Apache  Felix  File  Install



• Simple  and  Lightweight  deployer
 • Hotdeploy  directory
  • The  content  of  the  directory  represents  the  content  in  the  
    framework

• Support  for  bundles  and  configura<ons
Apache  Felix  File  Install

• Take  all  bundles  in  a  given  directory  and  install  
  them
• Start  all  bundles  
 • If  a  bundle  can‘t  be  resolved  try  it  again  the  next  <me
• Monitor  the  directory  and  
 • if  a  bundle  gets  removed  uninstall  it
 • if  a  bundle  gets  added  install  and  start  it
 • if  a  bundle  gets  updated  update  and  refresh  it
• Same  for  configura<ons
Summary


• File  Install  adds  hotdeploy  directory
• Supports  hotdeploy  of  bundles  and  
  configura<ons
• Can  be  extended  for  other  types  of  
  deployments
• Good  for  development  
Exercises

• Launch  a  framework  with  File  Install  and  Web  
  Console
  pax-­‐run.sh  
      -­‐-­‐profiles=felix.config,felix.fileinstall
• Check  the  bundles  with  Web  Console
• Deploy  the  main  paint  applica<on  and  some  
  shapes
• Add  and  remove  shapes  to  see  how  the  
  applica<on  behaves
Experience:  File  Install


• Great  for  development,  hot  deployment
• In  general  not  so  great  for  produc<on:  limited  
  control,  does  your  app  really  support  hot  
  deployment  at  “every”  point  in  <me?
• IF  you  use  it  in  produc<on,  at  least  customize  
  it,  but  look  for  other  solu<ons
OBR


• OBR  aMempts  to  define  a  common  bundle  
  repository
 • Enable  to  share,  discover,  and  deploy  
• Addresses:
 • Inability  of  developers  to  discover  and  re-­‐use  exis<ng  
   bundles
 • Difficulty  in  deploying  exis<ng  bundles
OBR  Status



• Oscar  bundle  repository
• OSGi  Bundle  Repository  RFC  112
• Current  status  unsure
 • Might  become  the  felix  bundlerepository
OBR  Design



• Generic  capability/requirement  model
 • XML  representa<on
 • Models  package,  bundle,  fragments,  na<ve,  and  
   service  dependencies  (plus  arbitrary  ones)
 • Repository  Admin  Service  for  discovery  and  
   deployment  of  bundles
High-­‐Level  View  


!"#$%&'$()*      ("8"("04"%         !"#$%&'$()*        4("6'"%
                                                                         !"%$,1"(
   +,"                                -./&0
                                       9
                                            4$0'6&0%
                                     :;;0

                                    !"#$%&'$()

                                       9
                                            4$0'6&0%
                                     :;;0
                     ("23&("%                          #($1&."%
!"23&("/"0'                         !"%$3(4"                             56#67&,&')
              :;;0              9                  9              :;;0
High-­‐Level  View


                         !"#$%&'$()*1   !"#$%&'$()*2


           !"#$%&'$()*
  /0&".'
             +,-&.

                         !"#$%&'$()*3   !"#$%&'$()*4




                                        !"#$%&'$()*5
Bindex



• Tool  to  create  xml  for  a  set  of  bundles
 • java  -­‐jar  bindex.jar  
    -­‐r  repository.xml  
    -­‐n  Paint  
    bundles/*.jar
XML


 !-'()*+,)-."#$%&%'()(*+''),%-.///0"&1,2+3*4'),%-.///0"///"5
 """"!-'*)1-2'5
 """"""""!3'*2-+(,+)45///!63'*2-+(,+)45
 """"""""!*+5'5///!6*+5'5
 """"""""!3)216'4,7,+)45///!63)216'4,7,+)45
 """"""""!*)1-2'5///!6*)1-2'5
 """"""""!27,'8)-."*7-.///065
 """"""""!27(79+0+,.5///!627(79+0+,.5
 """""""":::
 """"""""!-';1+-'6'4,5///!6-';1+-'6'4,5
 """""""":::
 """"!6-'*)1-2'5
 """":::
 !6-'()*+,)-.5
Summary


• OBR  is  addressing  to
 • find  exis<ng  bundles
 • use  exis<ng  bundles
 • share  bundles
• OBR  allows  to  resolve  the  transi<ve  closure  
  over  the  dependencies  of  a  bundle
Example



• Launch  a  framework  with  OBR
  pax-­‐run.sh  
  -­‐-­‐profiles=felix.obr
• Add  repository  to  OBR
• Deploy  bundles  from  OBR  via  shell
Experience




• Good  fit  if  you  have  a  „user“  driven  
  deployment  scenario
Apache  ACE


• Started  in  incubator  on  april  24th  2009
• So8ware  distribu<on  framework  
  based  on  OSGi
• 12  commiMers
• working  codebase
• hMp://incubator.apache.org/ace/
Deployment




    !"#$%&'(!                +%",-'(!


    !"#$%&'()   !"#$%&'"()   +%",-'()


    !"#$%&'(*                +%",-'(*
Keeping  the  history
                                 last year
                  !"#$%&'(!   *%"+,'(!
                                    last month
             !"#$%&'(!
                 !"#$%&'()       *%"+,'(!
                                            last week
          !"#$%&'(!
             !"#$%&'()              +%",-'(!
                              *%"+,'(-
                                 *%"+,'()               now

      !"#$%&'(!                          +%",-'(!
          !"#$%&'()                +%",-'()
                                 *%"+,'(-


      !"#$%&'()
          !"#$%&'(*                    +%",-'()
                                    +%",-'(*


      !"#$%&'(*                          +%",-'(*
Why?


• Automate  deployment
• Insight  into  who  uses  what
• History  of  each  system
• Consistent  development,  tes<ng,  produc<on
• Basis  for  several  possible  extensions
Topology


                                         !"#$%!
                                     0"&"$%0%&!.
                                        "$%&!


                                         !"#$%!
 /2,%&!
           *#(+,-,(&,&$.             0"&"$%0%&!.
                           &%!'(#)
              -%#+%#                    "$%&!


                                         !"#$%!
                                     0"&"$%0%&!.
                                        "$%&!
           /(0*(&%&!.
            #%*(-,!(#1
High  level  overview



      !"#"$!"$%&'
                               !"#$%&'"()
      ()$)*"("$+




                    !""#$%&'
High  level  overview




            !"#"$!"$%&'
            ()$)*"("$+
Dependency  Management




• Organizing  ar<facts
• Mapping  them  to  targets
Organizing  ar*facts

• group  ar<facts:  makes  them  manageable
• two  levels:  feature  and  distribu<on
• Analogy:  IKEA  catalog
• data  is  kept  in  “store  repository”


                                     !"#$%&'%(#)*"#$+

                           ,$-./0"       5%/"3$%        1*)"$*23-#4
Mapping  them  onto  targets


• mapping  distribu<ons  to  targets
• some<mes  done  by  an  external  system
• data  kept  in  “license  repository”


                                       !"#$%&$'($)*&"+*,-

                                 ."&+,"/01*%          23,4$+
User  Interface

• retrieve,  modify  and  store
• interact  with  OBR
High  level  overview



      !"#"$!"$%&'
                               !"#$%&'"()
      ()$)*"("$+




                    !""#$%&'
High  level  overview




            !"#$%&'"()
Deployment



• deployment  repository
• management  agent


                            !"#$%&'"()*+"#%,-)%.&

                           /0.1")           2.3405)
Deployment  Repository


&!"-)&'    ()"'*+,'             !"#$!%&'
              1       0/12323   7/12323
              4       0/12423   7/12323    8/42323
.!"-)&/0
              5       0/12423   8/42323    9/1232:
              6       8/42323   9/52323

              1       7/12323   9/52323
.!"-)&/7
              4       0/12123   7/12321    9/1232:
Management  Agent


             !"#"$%!%#&'"$%#&

         *'.#"/0#,        '('.#


        "#10)-2#$34
                        (/"!340)6
           3(*5


        !"#$%&'(%)$     "!*')+#,-
Deployment  Admin

• deployment  packages
• versioned  set  of  ar<facts
• transac<onal  install/update
• fix  packages  provide  deltas
• signing  makes  them  secure
• extensible  through  resource  processors
• AutoConfig  defines  configura<on  admin  data
From  dependency  to  deployment




          !"#$%&'%(#)*"#$+                           6*0%4)%&'%(#)*"#$+           1%(9#+:%4"&'%(#)*"#$+

,$-./0"       5%/"3$%        1*)"$*23-#4
                                           +   1*)"$*23-#4          7/$8%"
                                                                             =   7/$8%"           ,$-./0"
High  level  overview



      !"#"$!"$%&'
                               !"#$%&'"()
      ()$)*"("$+




                    !""#$%&'
High  level  overview




               !""#$%&'
Feedback


                                                                    !"#$%!
    *#(+,-,(&,&$.                                          /"&"$%/%&!.
                                                &%!'(#)
       -%#+%#                                                 "$%&!

                    012,!.                                                 012,!.
                     3($                                                    3($

!=#".%@A*?B*-%45(%23-'+*,C%151*%4521-
  $"#$E%;21-<*%$"%,+533*-
!:#".
!D#".!"#$"%&'()*+%,+'(+*-
  $"#$9                                                   !"#$"%&'()*+%,+'(+*-
$E#".!"#$.%/+'(01)%23-'+*%4(56%7*(,851%9%+5%:
  $"#.9                                                   !"#$.%/+'(01)%23-'+*%4(56%7*(,851%9%+5%:
$!#".!"#$.%;21-<*%"=%23-'+*-
  E$#$$                                                   !"#$.%;21-<*%"=%23-'+*-
     !"#$9%>3-'+*%+5%7*(,851%:%,2??**-*-
  E9#$$                                                   !"#$9%>3-'+*%+5%7*(,851%:%,2??**-*-
     !.#$9%&'()*+%,+533*-                                 !.#$9%&'()*+%,+533*-
Experience:  embedded


• Characteris<cs:  long  running,  deployed  in  
  places  you  cannot  reach,  not  always  on,  not  
  “reachable”  from  the  server
• most  “conven<onal”  management  tooling  is  
  fairly  useless  (JMX,  web  console,  ...)
• make  sure  you  can  deploy,  make  sure  you  can  
  see
Exercises

• Launch  ACE
  unzip,  then  go  into  folder  and  start  run.sh/bat
• Browse  to  the  UI
  hMp://localhost:8080/webui/
• Upload  the  set  of  bundles  for  the  Paint  app
  put  in  store/  folder
• Launch  a  target,  hook  it  up
  unzip,  then  go  into  folder  and  start  run.sh/bat
• Add  and  remove  things
Experience:  source  to  produc*on


• developer  runs  on  local  machine  (build  
  creates  bundles,  auto  deploys  to  ACE)
• con<nuous  build  feeds  test  servers  (deploy  
  like  you  would  in  produc<on)
• QA  team  uses  the  same  bundles,  performs  
  test  on  provisioned  systems
• release  management  finally  ships  to  customer
Ques*ons


                              We, Karl Pauls and Marcel Offermans, hereby
                              declare that this participant officially became a:




                       Certified
                          bundle manager
           Full Name



           Marcel and Karl are both OSGi experts. For additional training or help with your
                    project, contact them directly or via their companies’ websites.
    Marcel Offermans                                                      Karl Pauls
    marcel.offermans@luminis.nl                                           karl.pauls@akquinet.de




                         !"#$%&%'()**%%                            !"#$%"&&"'(
                         +$,%-./0,)1)2$.*34/5%678%9):$1.%

Weitere ähnliche Inhalte

Was ist angesagt?

LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6umapst
 
Low Carbon Housing for Non-experts
Low Carbon Housing for Non-expertsLow Carbon Housing for Non-experts
Low Carbon Housing for Non-expertsurbed
 
Prepositions made easy-xpert
Prepositions made easy-xpertPrepositions made easy-xpert
Prepositions made easy-xperthudaalmabadi
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
Phing101 or How to staff a build orchestra
Phing101 or How to staff a build orchestraPhing101 or How to staff a build orchestra
Phing101 or How to staff a build orchestraraphaelstolt
 
Experience Mining and Dialogues with a Pattern Language for Creative Learning
Experience Mining and Dialogues with a Pattern Language for Creative LearningExperience Mining and Dialogues with a Pattern Language for Creative Learning
Experience Mining and Dialogues with a Pattern Language for Creative LearningTakashi Iba
 
Carnet des innovations 20 fev 2012
Carnet des innovations 20 fev 2012Carnet des innovations 20 fev 2012
Carnet des innovations 20 fev 2012DFIE Lyon
 
Dramatically increase revenue on verio template
Dramatically increase revenue on verio templateDramatically increase revenue on verio template
Dramatically increase revenue on verio templateJanine Soika
 
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จันประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จันSarawut Chummongkhol
 
Science World Board Presentation
Science World Board PresentationScience World Board Presentation
Science World Board PresentationDanny Robinson
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with ExtbaseJochen Rau
 
The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17Security Ninja
 
Cysts of the jaw 10
Cysts of the jaw 10Cysts of the jaw 10
Cysts of the jaw 10Hai Trieu
 
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จันประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จันSarawut Chummongkhol
 
20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_selfgarrett honeycutt
 

Was ist angesagt? (20)

LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6LAMP_TRAINING_SESSION_6
LAMP_TRAINING_SESSION_6
 
Low Carbon Housing for Non-experts
Low Carbon Housing for Non-expertsLow Carbon Housing for Non-experts
Low Carbon Housing for Non-experts
 
Chinese
ChineseChinese
Chinese
 
Prepositions made easy-xpert
Prepositions made easy-xpertPrepositions made easy-xpert
Prepositions made easy-xpert
 
logic321
logic321logic321
logic321
 
EB-85 A
EB-85 AEB-85 A
EB-85 A
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
Phing101 or How to staff a build orchestra
Phing101 or How to staff a build orchestraPhing101 or How to staff a build orchestra
Phing101 or How to staff a build orchestra
 
Experience Mining and Dialogues with a Pattern Language for Creative Learning
Experience Mining and Dialogues with a Pattern Language for Creative LearningExperience Mining and Dialogues with a Pattern Language for Creative Learning
Experience Mining and Dialogues with a Pattern Language for Creative Learning
 
Carnet des innovations 20 fev 2012
Carnet des innovations 20 fev 2012Carnet des innovations 20 fev 2012
Carnet des innovations 20 fev 2012
 
CIDOC CRM in Practice
CIDOC CRM in PracticeCIDOC CRM in Practice
CIDOC CRM in Practice
 
Dramatically increase revenue on verio template
Dramatically increase revenue on verio templateDramatically increase revenue on verio template
Dramatically increase revenue on verio template
 
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จันประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
 
Science World Board Presentation
Science World Board PresentationScience World Board Presentation
Science World Board Presentation
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17
 
Cysts of the jaw 10
Cysts of the jaw 10Cysts of the jaw 10
Cysts of the jaw 10
 
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จันประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี  สสอ.แม่จัน
ประกาศและใบสมัครลูกจ้างชั่วคราว เจ้าพนักงานบัญชี สสอ.แม่จัน
 
20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self
 
BCIC Town hall may5th
BCIC Town hall may5thBCIC Town hall may5th
BCIC Town hall may5th
 

Ähnlich wie OSGI workshop - Become A Certified Bundle Manager

Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеYandex
 
Web API Directory: Statistics, Trends and Good Practices
Web API Directory: Statistics, Trends and Good PracticesWeb API Directory: Statistics, Trends and Good Practices
Web API Directory: Statistics, Trends and Good Practicesmashups
 
[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programmingnpinto
 
Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Cisco Russia
 
WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010Julian Dolby
 
Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Angelo van der Sijpt
 
Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonUIEpreviews
 
SEO - It Works Even if You Don’t Know How or Why
SEO - It Works Even if You Don’t Know How or Why SEO - It Works Even if You Don’t Know How or Why
SEO - It Works Even if You Don’t Know How or Why Wolfgang Weicht
 
Pearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the AirPearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the AirDan Murphy
 
The Lean Startup - simplified
The Lean Startup - simplifiedThe Lean Startup - simplified
The Lean Startup - simplifiedStefano Bernardi
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123Parag Gajbhiye
 
Introducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesIntroducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesSébastien Mosser
 
SANS Log Management 2
SANS Log Management 2SANS Log Management 2
SANS Log Management 2laurenfortune
 
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...Rick G. Garibay
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Empowering End-users to Find Point-of-interests with a Public Display
Empowering End-users to Find Point-of-interests with a Public DisplayEmpowering End-users to Find Point-of-interests with a Public Display
Empowering End-users to Find Point-of-interests with a Public DisplayTetsuo Yamabe
 
Application security
Application securityApplication security
Application securitykrusty43
 

Ähnlich wie OSGI workshop - Become A Certified Bundle Manager (20)

All about Apache ACE
All about Apache ACEAll about Apache ACE
All about Apache ACE
 
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
 
Web API Directory: Statistics, Trends and Good Practices
Web API Directory: Statistics, Trends and Good PracticesWeb API Directory: Statistics, Trends and Good Practices
Web API Directory: Statistics, Trends and Good Practices
 
[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming
 
Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500
 
WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010WALA Tutorial at PLDI 2010
WALA Tutorial at PLDI 2010
 
Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011Massive device deployment - EclipseCon 2011
Massive device deployment - EclipseCon 2011
 
Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff Patton
 
SEO - It Works Even if You Don’t Know How or Why
SEO - It Works Even if You Don’t Know How or Why SEO - It Works Even if You Don’t Know How or Why
SEO - It Works Even if You Don’t Know How or Why
 
Pearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the AirPearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the Air
 
The Lean Startup - simplified
The Lean Startup - simplifiedThe Lean Startup - simplified
The Lean Startup - simplified
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123
 
Introducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business ProcessesIntroducing Security Access Control Policies into Legacy Business Processes
Introducing Security Access Control Policies into Legacy Business Processes
 
SANS Log Management 2
SANS Log Management 2SANS Log Management 2
SANS Log Management 2
 
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...
Visual Studio 2013, Xamarin and Microsoft Azure Mobile Services: A Match Made...
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
Empowering End-users to Find Point-of-interests with a Public Display
Empowering End-users to Find Point-of-interests with a Public DisplayEmpowering End-users to Find Point-of-interests with a Public Display
Empowering End-users to Find Point-of-interests with a Public Display
 
Csharp intsight[1]
Csharp intsight[1]Csharp intsight[1]
Csharp intsight[1]
 
Csharp intsight
Csharp intsightCsharp intsight
Csharp intsight
 
Application security
Application securityApplication security
Application security
 

Mehr von Skills Matter

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard LawrenceSkills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimSkills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingSkills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveSkills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tSkills Matter
 

Mehr von Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 

Kürzlich hochgeladen

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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.pdfsudhanshuwaghmare1
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

OSGI workshop - Become A Certified Bundle Manager

  • 1. Become  a  Cer*fied   Bundle  Manager   today Karl  Pauls  &  Marcel  Offermans !"#$%&'&()"*
  • 2. Karl  @  Akquinet • Member  Apache  So8ware  Founda<on • PMC  Felix,  Sling,  Incubator • PPMC  Ace,  Clerezza • So8ware  Architect  at  akquinet • Co-­‐Author  „OSGi  in  Ac<on“ • karl.pauls@akquinet.de
  • 3. Marcel  @  luminis • Member  Apache  So8ware  Founda<on • CommiMer  and  PMC  member  at   Apache  Felix  and  Apache  ACE • So8ware  architect  at  Luminis  Technologies • Luminis:  group  of  companies,  strong  focus  on   technical  excellence,  offices  in  The   Netherlands  and  the  United  Kingdom • marcel.offermans@luminis.nl
  • 4. Requirements  for  exercises • Computer  with  Java  6  pre-­‐installed • Memory  s<ck  with  the  exercises
  • 5. Agenda • Quick  OSGi  recap • Bundle  management • Pax  Runner • File  Install • OBR • Apache  ACE
  • 6. OSGi:  core  +  compendium !"#$%"&'($)&%*+,-./'0 !"#$%"&'($)&%*+,-./'0 1/'&%"2&)$.$),-$/3 "&'($)&%1/02&34$50 45&%!"#$%6++$,3)& 67&%!"#$%8++$,3)& 7&+&,8&%9:%;&'8$/3%9<= 9&+&,:&%;<%=&':$/3%;>? >?3&%=@@A 85@5:-%?AAB
  • 7. Core !"#$%"&'($)&%*+,-./'0 1/'&%"2&)$.$),-$/3 45&%!"#$%6++$,3)& 7&+&,8&%9:%;&'8$/3%9<= >?3&%=@@A
  • 8. Framework ;/2:($ ;/2:($ ;/2:($ 4$-+"&$ !"#$%&'&($ 08:/($ 4$&/-".' 345"%#-*6$78-9 )*+*%,"-./*(%0*&1"2$
  • 9. -$?8(+$: *&C+$ Framework $2: /2"2?.*(( ?.8=="2< ?.8= /2"2?.*(($: ;/2:($ ;/2:($ ;/2:($ ;/2:($ 08:/($ "6=8-.? "6=8-.? $@=8-.? $@=8-.? $@=8-.? $@=8-.? 8-<B*=*&1$B/C(%DBE 8-<B*=*&1$B:>%DBH 8-<B*=*&1$B(8<%FBG 8-<B*=*&1$B/C(%DBD
  • 10. =/>("?1 /?$ /?$ Framework ;/2:($ ;/2:($ ;/2:($ ;/2:($ "2?.*(( !"#$%&'&($ "2?.*(($: ?.*-. ?.*-. ?.*-C2< -$?8(+$: *&C+$ $2: /2"2?.*(( ?.8=="2< ?.8= /2"2?.*(($: ;/2:($ ;/2:($ ;/2:($ ;/2:($ 08:/($
  • 11. Framework 4$-+"&$ !8< 4.8-$ A-$#? =/>("?1 =/>("?1 =/>("?1 /?$ /?$ /?$ ;/2:($ ;/2:($ ;/2:($ ;/2:($ "2?.*(( !"#$%&'&($ "2?.*(($:
  • 12. Compendium !"#$%"&'($)&%*+,-./'0 "&'($)&%1/02&34$50 67&%!"#$%8++$,3)& 9&+&,:&%;<%=&':$/3%;>? 85@5:-%?AAB
  • 13. OSGi  compendium User Admin Initial Provisioning Wire Admin Blueprint Container Device Access XML Parser Measurement and State Preferences UPnP™ Device Log Configuration Admin Position Remote Services Service Tracker Event Admin !"#$%"&'($)&%*+,-./'0 "&'($)&%1/02&34$50 HTTP 67&%!"#$%8++$,3)& Deployment Admin 9&+&,:&%;<%=&':$/3%;>? 85@5:-%?AAB IO Connector Execution Environment Spec Declarative Services Metatype
  • 16. ...  with  OSGi !"#$%&" • L3  -­‐  Provides  a  publish/find/bind   service  model  to  decouple  bundles • L2  -­‐  Manages  the  lifecycle  of  bundle  in   +%,"-&.&+" a  bundle  repository  without  requiring   the  VM  be  restarted • L1  -­‐  Creates  the  concept  of  bundles   that  use  classes  from  each  other  in  a   '()*+" controlled  way  according  to  constraints
  • 17. Experience:  oHen,  it’s  not  OSGi • Real  world  applica<ons  run  on • an  opera<ng  system,  inside  a  virtual  machine • and  have: • databases • non-­‐OSGi  clients • other  (na<ve)  files  /  data • For  the  BEST  experience,  make  everything   deployable
  • 18. Modularity • What? • Separa<on  of  concerns • Structure • Encapsula<on • Focuses  on • Cohesion  (low  is  bad,  high  is  good) • Coupling  (low  is  good,  high  is  bad) • Why? • Independent  development • Independent  maintenance • Improve  reusability
  • 19. OSGi  Bundle • A  bundle  is  a  module  in  OSGi  terminology • A  bundle  is  a  JAR  file  containing • Code • Resources )*+"'' )*+"'' )*+"'' • Metadata ),!+-.)/0&1 ),!+-.)/0&1 ),!+-.)/0&1 -.&(*) !"#$%& -.&(*) -.&(*) !"#$%&'(
  • 20. Bundle  Metadata • Bundle  metadata  captures • Human-­‐readable  informa<on • Bundle  iden<fica<on • Code  visibility • Stored  in  the  JAR  manifest  as  proper<es
  • 21. Version  Format • OSGi  uses  a  4-­‐part  version  numbering  scheme • <major>.<minor>.<micro>.<qualifier> • Major,  minor,  and  micro  are  numeric  values • Qualifier  is  a  string  value • Valid  examples • 1,  1.10,  1.9.9.alpha,  0.2.0.SNAPSHOT • Invalid  examples • 0.2.SNAPSHOT,  1.9.9-­‐alpha • Comparison  (not  always  intui<ve) • 1.0.0  <  1.9.9  <  1.10 • 1.0.0.beta  >  1.0.0.alpha  >  1.0.0
  • 22. Version  Range  Format • Interval  nota<on  is  used  for  version  ranges • Use  '['  or  ']'  for  inclusive  values • Use  '('  or  ')'  for  exclusive  values • Example  (quotes  needed) • "[1.0.0,2.0.0)"  ==  (1.0.0  <=  v  <  2.0.0) • When  a  version  range  is  expected,  a  single  value   represents  an  infinite  range • "1.0.0"  ==  (1.0.0  <=  v  <  ∞) • To  specify  a  precise  version • "[1.0.0,1.0.0]"
  • 23. Experience:  versioning • Choose  a  versioning  policy  and  s<ck  with  it • Version  all  packages  you  export • Use  version  ranges  on  import  that  are   consistent  with  policy • If  you  FORGET  this  you  will  REGRET  it • Do  not  be  tempted  to  mis-­‐use  commercial   versions  internally • Only  bump  versions  on  actual  changes
  • 24. Version  Policy • Major  number  change  –  signifies  an  incompa<ble   update.   • Minor  number  change  –  signifies  a  backward   compa<ble  update.   • Micro  number  change  –  signifies  an  internal  update   (e.g.,  a  bug  fix  or  performance  improvement).   • Qualifier  change  –  signifies  a  trivial  internal  change   with  “outward”  no<ceable  difference,  but   nonetheless  is  a  new  ar<fact  (e.g.,  line  number   refactoring).  
  • 25. Tip:  Seman*c  Versioning  whitepaper Semantic Versioning Technical Whitepaper Revision 1.0 May 6, 2010 © 2010 OSGi Alliance All Rights Reserved. Source:  h*p://www.osgi.org/wiki/uploads/Links/Seman9cVersioning.pdf
  • 26. Exposing  Internal  Code ! • Expor<ng  a  versioned  package • Export-­‐Package:  javax.servlet;  version="2.4.0" • Can  also  specify  arbitrary  matching  aMributes • Export-­‐Package:  javax.servlet;  javax.servlet.hMp;  version="2.4.0";  "vendor=ASF"
  • 27. Downsides  and  Pialls !!"#$%&'(")) !"#" *++ !!"#$%&'(")) !"#" *++ ,&(-./01 ,&(-./01 5&(-./01 !&*+)# $%&'#%#()" $%&'#%#()" *++234$ *++234$
  • 28. Best  Prac*ce !!"#$%&'(")) !"#" *++ *+,-./0,-1 *+,-./+,+1 $%&'#%#()" *++,-.$
  • 29. Impor*ng  &  Expor*ng  a  Package  (1/4) • Imagine  bundle  A  somehow  gets  servlet   instances  from  bundle  B /,%&'( )*+*,-./'+0/( " #$%&'( -10*.. )*+*,-./'+0/( ! &2/31&%43&5 )*+*,-./'+0/(
  • 30. Impor*ng  &  Expor*ng  a  Package  (1/4) • What  if  bundle  A  also  wanted  to  get  servlet   instances  somehow  from  bundle  C? /,%&'( )*+*,-./'+0/( " #$%&'( -10*.. )*+*,-./'+0/( ! &2/31&%43&5 )*+*,-./'+0/(
  • 31. Impor*ng  &  Expor*ng  a  Package  (2/4) • Bundle  C  could  import  from  bundle  B,  but   then  it  is  dependent  on  it #$%&'( )*+*,-./'+0/( 6 /,%&'( )*+*,-./'+0/( " #$%&'( -10*.. )*+*,-./'+0/( ! &2/31&%43&5 )*+*,-./'+0/(
  • 32. Impor*ng  &  Expor*ng  a  Package  (3/4) • Bundle  C  could  export  its  own  servlet   package,  but  bundle  A  could  only  see  either  C   or  B /,%&'( )*+*,-./'+0/( " -10*.. #$%&'( )*+*,-./'+0/( ! (2&31&%#/.3&4 666 )*+*,-./'+0/( 5 -10*.. /,%&'( )*+*,-./'+0/(
  • 33. Impor*ng  &  Expor*ng  a  Package  (4/4) • Bundle  C  could  both  import  and  export   servlet  to  solve  the  dilemma /,%&'(1*231#$%&'( )*+*,-./'+0/( " -40*.. /,%&'(1*231#$%&'( )*+*,-./'+0/( 5 #$%&'( -40*.. )*+*,-./'+0/( !
  • 34. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this Interface package org.foo.http; import javax.servlet; public interface HttpService { void registerServlet(Sting alias, Servlet servlet); } Metadata Export-Package: org.foo.http; version="1.0.0" Import-Package: javax.servlet; version="2.3.0"
  • 35. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this ),-.'/ &2-.'/ &2-.'/ 01(123%&'(4&/ 01(123%&'(4&/ .':3;..3<=- (&'%).5673839 (&'%).5673839 !""#$ + %&'()*&
  • 36. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this ),-.'/ ),-.'/ &2-.'/ 01(123%&'(4&/ ),-.'/ &2-.'/ 01(123%&'(4&/ 01(123%&'(4&/ (&'%).5673>39 .':3;..3<=- .':3;..3<=- (&'%).5673839 (&'%).5673839 !""#$ !""#$ + *4)&5/ %&'()*&
  • 37. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this &,-.'/ &,-.'/ 01(1,2%&'(3&/ &,-.'/ 01(1,2%&'(3&/ (&'%).4562>28 .'92:..2;<- (&'%).4562728 = !""#$ !""#$ + *3)&4/ %&'()*&
  • 38. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this &,-.'/ &,-.'/ 01(1,2%&'(3&/ &,-.'/ 01(1,2%&'(3&/ (&'%).4562>28 .'92:..2;<- (&'%).4562728 = !""#$ !""#$ + *3)&4/ %&'()*& This  would  result  in  a ClassCastExcep<on, why?
  • 39. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this &,-.'/ &,-.'/ 01(1,2%&'(3&/ &,-.'/ 01(1,2%&'(3&/ (&'%).4562>28 .'92:..2;<- (&'%).4562728 = !""#$ !""#$ + *3)&4/ %&'()*&
  • 40. Advanced  Consistency  Checking • Some<mes  more  advanced  consistency   checking  is  necessary,  consider  this We  need  to  declare  such internal  dependencies! &,-.'/ &,-.'/ 01(1,2%&'(3&/ &,-.'/ 01(1,2%&'(3&/ (&'%).4562>28 .'92:..2;<- (&'%).4562728 = !""#$ !""#$ + *3)&4/ %&'()*& ?@%&%? Metadata Export-Package: org.foo.http; version="1.0.0"; uses:="javax.servlet" Import-Package: javax.servlet; version="2.3.0"
  • 41. Run-­‐Time  Bundle  Iden*fica*on • Bundle  symbolic  name  plus  bundle  version • Assigned  in  the  bundle  metadata • Install  loca<on • Assigned  when  installing  bundle • Typically  the  URL  from  which  the  bundle  is  retrieved • Bundle  iden<fier • Assigned  by  the  framework • A  long  value  which  increases  for  each  installed   bundled
  • 42. Framework  Bundle  Cache • The  framework  maintains  a  bundle  cache • Installing  a  bundle  saves  it  to  the  cache • Once  installed,  the  original  bundle  JAR  file  is  no  longer  needed • Subsequent  framework  execu<ons  will  reload  the  cached  bundles • The  framework  also  saves  the  bundle  state  in  the   bundle  cache • When  a  bundle  is  started,  it  is  persistently  recorded  as  being   ac<ve • Ac<ve  bundles  will  be  restarted  in  subsequent  framework   execu<ons • Upda<ng  and  uninstalling  bundles  also  impact  the   cache,  but  it  is  a  liMle  more  complicated
  • 43. Package  Admin • Framework  provides  special  API  for  this   purpose public interface PackageAdmin { static final int BUNDLE_TYPE_FRAGMENT = 0x00000001; Bundle getBundle(Class clazz); Bundle[] getBundles(String symbolicName, String versionRange); int getBundleType(Bundle bundle); ExportedPackage getExportedPackage(String name); ExportedPackage[] getExportedPackages(Bundle bundle); ExportedPackage[] getExportedPackages(String name); Bundle[] getFragments(Bundle bundle); RequiredBundle[] getRequiredBundles(String symbolicName); Bundle[] getHosts(Bundle bundle); void refreshPackages(Bundle[] bundles); boolean resolveBundles(Bundle[] bundles); }
  • 44. Paint  Program  Design  (1/2) • Rela<onship  between  classes !"#$%& 9%:#53.& '(#)*%( !"#$% +#,-.&/(#0% !,0$3%&!"#$% !"#$%& 1,()3% !45#(% '(,#-63% '(#$%72,8 120$2-%-.
  • 45. Paint  Program  Design  (2/2) 1#,23) )*(+,% +,-./++.0'"() &45",) !"#$% &'"() 6,#"$-3) 6,"()7+#8
  • 46. Demo
  • 47. Experience:  Swing • First  of  all,  how  do  you  modularize  a  UI? • Second,  how  dynamic  do  you  want  it  to  be? • Third:  dealing  with  already  instan<ated  stuff   (panels,  look  and  feel,  ...) • For  more  info: hMp://lsd.luminis.nl/swing-­‐and-­‐osgi
  • 48. Pax  Runner • Hosted  at  OPS4J • Bootstrapper  for  OSGi  frameworks • ini<al  provisioning  of  bundles • great  tool  for  developers
  • 49. Pax  Runner • Unzip  the  archive,  add  to  path • selec<ng  the  framework • op<ons,  op<ons,  op<ons • profiles  and  ini<al  provisioning • crea<ng  a  distribu<on
  • 50. Pax  Runner  -­‐  Frameworks • Run  the  default  framework: pax-­‐run.sh • Run  Equinox  version  3.5.1: pax-­‐run.sh  -­‐-­‐playorm=equinox  -­‐-­‐version=3.5.1 • Run  with  a  pre-­‐defined  profile: pax-­‐run.sh  -­‐-­‐profiles=felix.webconsole
  • 51. Pax  Runner  -­‐  Windows  FAQ 009.  I'm  using  Pax  Runner  on  DOS/Windows,  I  have  the  right   command  but  I'm  ge{ng  strange  errors DOS/Windows  shell  seems  to  strip  the  equals  (=)  from  the   command  line  and  treats  the  leD  and  right  side  of  the  equals  as   separate  arguments  for  the  batch  file.  Thus,  the  arguments  to   the  java  executable  for  an  argument  like  (for  example)  -­‐-­‐ profiles=log  will  be  split  in  two  arguments  as  -­‐-­‐profiles  and  log.   To  avoid  this  you  will  have  to  enclose  the  en9re  argument   between  quotes  (")  as  in  "-­‐-­‐profiles=log". Source:  h*p://paxrunner.ops4j.org/display/paxrunner/FAQ
  • 52. Pax  Runner  -­‐  Provisioning • Provisioning  your  own  bundles: • Create  a  text  file  with  the  bundle  URLs  (called   “profile”): file:paint/servicebased.host-­‐1.0.0.jar file:paint/servicebased.circle-­‐1.0.0.jar • Point  to  the  file  when  launching: pax-­‐run.sh  -­‐-­‐args=file:profile • Provisioning  all  bundles  in  a  directory: pax-­‐run.sh  mybundledir/
  • 53. Pax  Runner  -­‐  Crea*ng  scripts • Crea<ng  a  script  to  launch  a  framework   without  Pax  Runner: pax-­‐run.sh  -­‐-­‐executor=script          -­‐-­‐workingDirectory=. • Create  an  archive  containing  everything  you   need  to  run: pax-­‐run.sh  -­‐-­‐executor=zip          -­‐-­‐profiles=felix.webconsole,compendium
  • 54. Excercises • Launch  Pax  Runner  with  different  fw’s • Launch  a  profile  (felix.webconsole) hMp://localhost:8080/system/console   and  log  in  as  admin/admin • Create  a  profile  for  the  Paint  Program • Add  webconsole  (for  monitoring) • Create  a  distributable  ZIP  file  with  Pax  Runner
  • 55. Experience:  Pax  Runner • great  for  development • nicely  integrates  into  build  environment • base  for  Pax  Exam  (tes<ng  framework) • don’t  ship  to  customers  (needs  online   connec<on,  usually  you  don’t  want  that  much   freedom)
  • 56. Apache  Felix  File  Install • Simple  and  Lightweight  deployer • Hotdeploy  directory • The  content  of  the  directory  represents  the  content  in  the   framework • Support  for  bundles  and  configura<ons
  • 57. Apache  Felix  File  Install • Take  all  bundles  in  a  given  directory  and  install   them • Start  all  bundles   • If  a  bundle  can‘t  be  resolved  try  it  again  the  next  <me • Monitor  the  directory  and   • if  a  bundle  gets  removed  uninstall  it • if  a  bundle  gets  added  install  and  start  it • if  a  bundle  gets  updated  update  and  refresh  it • Same  for  configura<ons
  • 58. Summary • File  Install  adds  hotdeploy  directory • Supports  hotdeploy  of  bundles  and   configura<ons • Can  be  extended  for  other  types  of   deployments • Good  for  development  
  • 59. Exercises • Launch  a  framework  with  File  Install  and  Web   Console pax-­‐run.sh      -­‐-­‐profiles=felix.config,felix.fileinstall • Check  the  bundles  with  Web  Console • Deploy  the  main  paint  applica<on  and  some   shapes • Add  and  remove  shapes  to  see  how  the   applica<on  behaves
  • 60. Experience:  File  Install • Great  for  development,  hot  deployment • In  general  not  so  great  for  produc<on:  limited   control,  does  your  app  really  support  hot   deployment  at  “every”  point  in  <me? • IF  you  use  it  in  produc<on,  at  least  customize   it,  but  look  for  other  solu<ons
  • 61. OBR • OBR  aMempts  to  define  a  common  bundle   repository • Enable  to  share,  discover,  and  deploy   • Addresses: • Inability  of  developers  to  discover  and  re-­‐use  exis<ng   bundles • Difficulty  in  deploying  exis<ng  bundles
  • 62. OBR  Status • Oscar  bundle  repository • OSGi  Bundle  Repository  RFC  112 • Current  status  unsure • Might  become  the  felix  bundlerepository
  • 63. OBR  Design • Generic  capability/requirement  model • XML  representa<on • Models  package,  bundle,  fragments,  na<ve,  and   service  dependencies  (plus  arbitrary  ones) • Repository  Admin  Service  for  discovery  and   deployment  of  bundles
  • 64. High-­‐Level  View   !"#$%&'$()* ("8"("04"% !"#$%&'$()* 4("6'"% !"%$,1"( +," -./&0 9 4$0'6&0% :;;0 !"#$%&'$() 9 4$0'6&0% :;;0 ("23&("% #($1&."% !"23&("/"0' !"%$3(4" 56#67&,&') :;;0 9 9 :;;0
  • 65. High-­‐Level  View !"#$%&'$()*1 !"#$%&'$()*2 !"#$%&'$()* /0&".' +,-&. !"#$%&'$()*3 !"#$%&'$()*4 !"#$%&'$()*5
  • 66. Bindex • Tool  to  create  xml  for  a  set  of  bundles • java  -­‐jar  bindex.jar   -­‐r  repository.xml   -­‐n  Paint   bundles/*.jar
  • 67. XML !-'()*+,)-."#$%&%'()(*+''),%-.///0"&1,2+3*4'),%-.///0"///"5 """"!-'*)1-2'5 """"""""!3'*2-+(,+)45///!63'*2-+(,+)45 """"""""!*+5'5///!6*+5'5 """"""""!3)216'4,7,+)45///!63)216'4,7,+)45 """"""""!*)1-2'5///!6*)1-2'5 """"""""!27,'8)-."*7-.///065 """"""""!27(79+0+,.5///!627(79+0+,.5 """"""""::: """"""""!-';1+-'6'4,5///!6-';1+-'6'4,5 """"""""::: """"!6-'*)1-2'5 """"::: !6-'()*+,)-.5
  • 68. Summary • OBR  is  addressing  to • find  exis<ng  bundles • use  exis<ng  bundles • share  bundles • OBR  allows  to  resolve  the  transi<ve  closure   over  the  dependencies  of  a  bundle
  • 69. Example • Launch  a  framework  with  OBR pax-­‐run.sh   -­‐-­‐profiles=felix.obr • Add  repository  to  OBR • Deploy  bundles  from  OBR  via  shell
  • 70. Experience • Good  fit  if  you  have  a  „user“  driven   deployment  scenario
  • 71. Apache  ACE • Started  in  incubator  on  april  24th  2009 • So8ware  distribu<on  framework   based  on  OSGi • 12  commiMers • working  codebase • hMp://incubator.apache.org/ace/
  • 72. Deployment !"#$%&'(! +%",-'(! !"#$%&'() !"#$%&'"() +%",-'() !"#$%&'(* +%",-'(*
  • 73. Keeping  the  history last year !"#$%&'(! *%"+,'(! last month !"#$%&'(! !"#$%&'() *%"+,'(! last week !"#$%&'(! !"#$%&'() +%",-'(! *%"+,'(- *%"+,'() now !"#$%&'(! +%",-'(! !"#$%&'() +%",-'() *%"+,'(- !"#$%&'() !"#$%&'(* +%",-'() +%",-'(* !"#$%&'(* +%",-'(*
  • 74. Why? • Automate  deployment • Insight  into  who  uses  what • History  of  each  system • Consistent  development,  tes<ng,  produc<on • Basis  for  several  possible  extensions
  • 75. Topology !"#$%! 0"&"$%0%&!. "$%&! !"#$%! /2,%&! *#(+,-,(&,&$. 0"&"$%0%&!. &%!'(#) -%#+%# "$%&! !"#$%! 0"&"$%0%&!. "$%&! /(0*(&%&!. #%*(-,!(#1
  • 76. High  level  overview !"#"$!"$%&' !"#$%&'"() ()$)*"("$+ !""#$%&'
  • 77. High  level  overview !"#"$!"$%&' ()$)*"("$+
  • 78. Dependency  Management • Organizing  ar<facts • Mapping  them  to  targets
  • 79. Organizing  ar*facts • group  ar<facts:  makes  them  manageable • two  levels:  feature  and  distribu<on • Analogy:  IKEA  catalog • data  is  kept  in  “store  repository” !"#$%&'%(#)*"#$+ ,$-./0" 5%/"3$% 1*)"$*23-#4
  • 80. Mapping  them  onto  targets • mapping  distribu<ons  to  targets • some<mes  done  by  an  external  system • data  kept  in  “license  repository” !"#$%&$'($)*&"+*,- ."&+,"/01*% 23,4$+
  • 81. User  Interface • retrieve,  modify  and  store • interact  with  OBR
  • 82. High  level  overview !"#"$!"$%&' !"#$%&'"() ()$)*"("$+ !""#$%&'
  • 84. Deployment • deployment  repository • management  agent !"#$%&'"()*+"#%,-)%.& /0.1") 2.3405)
  • 85. Deployment  Repository &!"-)&' ()"'*+,' !"#$!%&' 1 0/12323 7/12323 4 0/12423 7/12323 8/42323 .!"-)&/0 5 0/12423 8/42323 9/1232: 6 8/42323 9/52323 1 7/12323 9/52323 .!"-)&/7 4 0/12123 7/12321 9/1232:
  • 86. Management  Agent !"#"$%!%#&'"$%#& *'.#"/0#, '('.# "#10)-2#$34 (/"!340)6 3(*5 !"#$%&'(%)$ "!*')+#,-
  • 87. Deployment  Admin • deployment  packages • versioned  set  of  ar<facts • transac<onal  install/update • fix  packages  provide  deltas • signing  makes  them  secure • extensible  through  resource  processors • AutoConfig  defines  configura<on  admin  data
  • 88. From  dependency  to  deployment !"#$%&'%(#)*"#$+ 6*0%4)%&'%(#)*"#$+ 1%(9#+:%4"&'%(#)*"#$+ ,$-./0" 5%/"3$% 1*)"$*23-#4 + 1*)"$*23-#4 7/$8%" = 7/$8%" ,$-./0"
  • 89. High  level  overview !"#"$!"$%&' !"#$%&'"() ()$)*"("$+ !""#$%&'
  • 91. Feedback !"#$%! *#(+,-,(&,&$. /"&"$%/%&!. &%!'(#) -%#+%# "$%&! 012,!. 012,!. 3($ 3($ !=#".%@A*?B*-%45(%23-'+*,C%151*%4521- $"#$E%;21-<*%$"%,+533*- !:#". !D#".!"#$"%&'()*+%,+'(+*- $"#$9 !"#$"%&'()*+%,+'(+*- $E#".!"#$.%/+'(01)%23-'+*%4(56%7*(,851%9%+5%: $"#.9 !"#$.%/+'(01)%23-'+*%4(56%7*(,851%9%+5%: $!#".!"#$.%;21-<*%"=%23-'+*- E$#$$ !"#$.%;21-<*%"=%23-'+*- !"#$9%>3-'+*%+5%7*(,851%:%,2??**-*- E9#$$ !"#$9%>3-'+*%+5%7*(,851%:%,2??**-*- !.#$9%&'()*+%,+533*- !.#$9%&'()*+%,+533*-
  • 92. Experience:  embedded • Characteris<cs:  long  running,  deployed  in   places  you  cannot  reach,  not  always  on,  not   “reachable”  from  the  server • most  “conven<onal”  management  tooling  is   fairly  useless  (JMX,  web  console,  ...) • make  sure  you  can  deploy,  make  sure  you  can   see
  • 93. Exercises • Launch  ACE unzip,  then  go  into  folder  and  start  run.sh/bat • Browse  to  the  UI hMp://localhost:8080/webui/ • Upload  the  set  of  bundles  for  the  Paint  app put  in  store/  folder • Launch  a  target,  hook  it  up unzip,  then  go  into  folder  and  start  run.sh/bat • Add  and  remove  things
  • 94. Experience:  source  to  produc*on • developer  runs  on  local  machine  (build   creates  bundles,  auto  deploys  to  ACE) • con<nuous  build  feeds  test  servers  (deploy   like  you  would  in  produc<on) • QA  team  uses  the  same  bundles,  performs   test  on  provisioned  systems • release  management  finally  ships  to  customer
  • 95. Ques*ons We, Karl Pauls and Marcel Offermans, hereby declare that this participant officially became a: Certified bundle manager Full Name Marcel and Karl are both OSGi experts. For additional training or help with your project, contact them directly or via their companies’ websites. Marcel Offermans Karl Pauls marcel.offermans@luminis.nl karl.pauls@akquinet.de !"#$%&%'()**%% !"#$%"&&"'( +$,%-./0,)1)2$.*34/5%678%9):$1.%