OSGi                          Introduction                                    By Peter Kriens                           OS...
donderdag 24 maart 2011
In the beginnings there                                were bits ...donderdag 24 maart 2011
0100111100110010000000001111000                          0001000010001110010100000010011      Bits                        ...
0100111100110010000000001111000                          0001000010001110010100000010011      Bits                        ...
117                          062                          000                          360                          041   ...
4F                          32   00 F0                          21   1C A0                          4E                    ...
MOV   C,A                          STA   F000H                          LXI   H,A01CH                          MOV   C,M  ...
MOV   C,A                          STA   F000H                          LXI   H,A01CH                          MOV   C,M  ...
Code                          global = shared;                          for (local=0;                            local<10;...
Code                          global = shared;                          for (local=0;                            local<10;...
int global;                              int shared;                              int local;      Code                    ...
int global;                              int shared;                              int local;      Functions               ...
int global;                              int shared;                              int local;      Functions               ...
int global;                              int shared;                              int local;      Functions               ...
int global;                              int shared;                           void foo() {      Functions                ...
int global;                                        int shared;                          A      Modules                    ...
int global;                                        int shared;                          A      Modules                    ...
int global;                          A             int shared;      Modules                           void foo() {        ...
Class A           int shared;                           void foo() {             void bar() {      Objects                ...
Class A           int shared;                           void foo() {             void bar() {      Objects                ...
ces                                    Class A                     tan                                   Class A          ...
“Chapter 7 describes the structure of a                          program which is organized into packages                 ...
“Chapter 7 describes the structure of a                          program which is organized into packages                 ...
package com.acme.abc      Packages                          Class A        int shared;                      Class B       ...
The Face of Modularitydonderdag 24 maart 2011
The Face of Modularitydonderdag 24 maart 2011
Modularity’s Secret               • modules have a private                      space and share a                      pub...
Modularity’s Secret               • modules have a private                      space and share a                      pub...
Modularity’s Secret               • modules have a private                      space and share a                      pub...
JAR abc-1.2.3-SNAPSHOT.jar                            com.acme.abc                                                        ...
JAR abc-1.2.3-SNAPSHOT.jar                            com.acme.abc                                                        ...
Java VM        party      common       resolver      axis        xercesBegin                        rt       assetmaint   ...
Java VM        party      common       resolver      axis         xercesBegin                        rt       assetmaint  ...
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
Manifest               Manifest-Version: 1               Bundle-ManifestVersion: 2               Bundle-SymbolicName: com....
Manifest               Manifest-Version: 1               Bundle-ManifestVersion: 2               Bundle-SymbolicName: com....
bundle com.acme.abc-1.2.3                            package com.acme.abc                                                 ...
bundle com.acme.abc-1.2.3      Bundles                          bundle com.acme.def-9.9.1donderdag 24 maart 2011
bundle com.acme.abc-1.2.3      Bundles                                             ed                                     ...
POJO Programming is                             Best Practicedonderdag 24 maart 2011
Interfaces/API                    Consumer                    Provider                                    Interface       ...
Interfaces/API           package com.consumer.impl   package com.api   package com.provider.impl                    Consum...
Interfaces/API           package com.consumer.impl   package com.api   package com.provider.impl                    Consum...
Interfaces/API           package com.consumer.impl    package com.api   package com.provider.impl                    Consu...
Interfaces/API           package com.consumer.impl    package com.api   package com.provider.impl                    Consu...
Access to                            Implementations           package com.consumer.impl   package com.api   package com.p...
Access to                            Implementations           package com.consumer.impl   package com.api   package com.p...
Access to                            Implementations           package com.consumer.impl   package com.api   package com.p...
Access to                            Implementations           package com.consumer.impl           com.consumer.impl      ...
µServicesdonderdag 24 maart 2011
µServices                            package com.api                                specifiesdonderdag 24 maart 2011
µServices                            package com.api                                                   bundle             ...
µServices                            package com.api                                                   bundle             ...
µServices                                 package com.api                bundle                                  bundle   ...
µServices                                     package com.api                bundle                                      b...
Trivial To Use With DS               package com.consumer.impl;               @Component               public class Consum...
µServices                                 factory                bundle                          bundle           com.cons...
µServices                bundle                            bundle           com.consumer.impl                 com.provider...
µServices                bundle                             bundle           com.consumer.impl                  com.provid...
µServices                bundle                             bundle           com.consumer.impl                  com.provid...
µServices                                              bundle                                               com.          ...
µServices                            bundle                                                      bundle                   ...
µServices                            bundle                                                      bundle                   ...
Service Specifications                            condpermadmin        permission admin    measurement                    ...
OSGi                   •      Next generation of strong modularity in Bundles                          • Imports and Expor...
JAX London London                             jaxlondon.com   11-13 April 2011donderdag 24 maart 2011
Join us                                 !                          JAX London London                             jaxlondon...
Upcoming SlideShare
Loading in...5
×

Introduction into OSGi

4,290

Published on

The EclipseCon/OSGi DevCon 2011 Introduction by Peter Kriens

1 Comment
8 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,290
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
327
Comments
1
Likes
8
Embeds 0
No embeds

No notes for slide

Introduction into OSGi

  1. 1. OSGi Introduction By Peter Kriens OSGi Technical Director & Evangelistdonderdag 24 maart 2011
  2. 2. donderdag 24 maart 2011
  3. 3. In the beginnings there were bits ...donderdag 24 maart 2011
  4. 4. 0100111100110010000000001111000 0001000010001110010100000010011 Bits 1000100011011111100010001110111 1101101001000010011101000000111 1110000010100000110111000010000 0110110100000001100100010001110 10000001110110donderdag 24 maart 2011
  5. 5. 0100111100110010000000001111000 0001000010001110010100000010011 Bits 1000100011011111100010001110111 1101101001000010011101000000111 1110000010100000110111000010000 0110110100000001100100010001110 10000001110110donderdag 24 maart 2011
  6. 6. 117 062 000 360 041 034 240 116 043 Octal 176 043 276 322 023 240 176 012 015 302 015 240 062 043 240 166donderdag 24 maart 2011
  7. 7. 4F 32 00 F0 21 1C A0 4E 23 7E Hex 23 BE D2 13 A0 7E 0A 0D C2 0D A0 32 23 A0 76donderdag 24 maart 2011
  8. 8. MOV C,A STA F000H LXI H,A01CH MOV C,M INX H Code MOV A,M INX H CMP M JNC A013H MOV A,M DCR C JNZ A00DH STA A023H HLTdonderdag 24 maart 2011
  9. 9. MOV C,A STA F000H LXI H,A01CH MOV C,M INX H Code MOV A,M INX H CMP M JNC A013H MOV A,M DCR C JNZ A00DH STA A023H HLTdonderdag 24 maart 2011
  10. 10. Code global = shared; for (local=0; local<10; local++) shared *= 10;donderdag 24 maart 2011
  11. 11. Code global = shared; for (local=0; local<10; local++) shared *= 10;donderdag 24 maart 2011
  12. 12. int global; int shared; int local; Code global = shared; for (local=0; local<10; local++) shared *= 10;donderdag 24 maart 2011
  13. 13. int global; int shared; int local; Functions void foo() { global = shared; for (local=0; local<10; local++) shared *= 10; }donderdag 24 maart 2011
  14. 14. int global; int shared; int local; Functions void foo() { global = shared; for (local=0; local<10; local++) shared *= 10; }donderdag 24 maart 2011
  15. 15. int global; int shared; int local; Functions void foo() { global = shared; for (local=0; local<10; local++) shared *= 10; } void bar() { global = shared; for (local=0; local<10; local++) shared *= 10; }donderdag 24 maart 2011
  16. 16. int global; int shared; void foo() { Functions int local global = shared; for (local=0; local<10; local++) shared *= 10; } void bar() { int local; global = shared; for (local=0; local<10; local++) shared *= 10; }donderdag 24 maart 2011
  17. 17. int global; int shared; A Modules void foo() { void bar() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } B void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  18. 18. int global; int shared; A Modules void foo() { void bar() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } B void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  19. 19. int global; A int shared; Modules void foo() { void bar() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } B int shared; void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  20. 20. Class A int shared; void foo() { void bar() { Objects int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } Class B int shared; void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  21. 21. Class A int shared; void foo() { void bar() { Objects int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } Class B int shared; void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  22. 22. ces Class A tan Class A Class A ins Class A Class A int shared; void foo() { void bar() { Objects int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } } Class B int shared; void foo() { void xyz() { int local int local global = shared; global = shared; for (local=0; for (local=0; local<10; local++) local<10; local++) shared *= 10; shared *= 10; } }donderdag 24 maart 2011
  23. 23. “Chapter 7 describes the structure of a program which is organized into packages similar to the modules of Modula.” Java Language Specification, 3rd editiondonderdag 24 maart 2011
  24. 24. “Chapter 7 describes the structure of a program which is organized into packages similar to the modules of Modula.” Java Language Specification, 3rd editiondonderdag 24 maart 2011
  25. 25. package com.acme.abc Packages Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { int local int local int local int local global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local+ local<10; local+ local<10; local+ local<10; local+ +) +) +) +) shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } package com.acme.def Class A int shared; Class C int shared; void foo() { void bar() { void foo() { void xyz() { int local int local int local int local global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local+ local<10; local+ local<10; local+ local<10; local+ +) +) +) +) shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } }donderdag 24 maart 2011
  26. 26. The Face of Modularitydonderdag 24 maart 2011
  27. 27. The Face of Modularitydonderdag 24 maart 2011
  28. 28. Modularity’s Secret • modules have a private space and share a public space A B • modules limit their visibility and exposure C D • From geometric to linear complexity • And something extra ...donderdag 24 maart 2011
  29. 29. Modularity’s Secret • modules have a private space and share a public space A B • modules limit their Pub visibility and exposure C D • From geometric to linear complexity • And something extra ...donderdag 24 maart 2011
  30. 30. Modularity’s Secret • modules have a private space and share a public space A B • modules limit their Pub visibility and exposure C D • From geometric to linear complexity • And something extra ...donderdag 24 maart 2011
  31. 31. JAR abc-1.2.3-SNAPSHOT.jar com.acme.abc com.acme.def Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local JARs global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } JAR def-4.5.6.jar com.acme.abc com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  32. 32. JAR abc-1.2.3-SNAPSHOT.jar com.acme.abc com.acme.def Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local JARs global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } JAR def-4.5.6.jar com.acme.abc com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  33. 33. Java VM party common resolver axis xercesBegin rt assetmaint catalina mail ezmorph xmlapis jce hhfacility base jenks servlets xmlrpcHere jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov. manufact. widget httpunit jdbm dnsns product … mx4j bsf .. bi rome batik bsh marketing workflow jpos18 fop velocity workeffort ecommerce jcl tomcat ws-commons ebay oagis barcode4j poi geronimo minerva … freemarker lucene .. minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4jdonderdag 24 maart 2011
  34. 34. Java VM party common resolver axis xercesBegin rt assetmaint catalina mail ezmorph xmlapis jce hhfacility base jenks servlets xmlrpcHere jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov. manufact. widget httpunit jdbm dnsns product … mx4j bsf .. bi rome batik bsh Class marketing workflow jpos18 fop velocity Not workeffort ecommerce jcl tomcat ws-commons Found ebay oagis barcode4j poi geronimo Exception minerva … freemarker lucene .. minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4jdonderdag 24 maart 2011
  35. 35. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  36. 36. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  37. 37. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  38. 38. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  39. 39. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } X bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; Private Exported void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  40. 40. Manifest Manifest-Version: 1 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.acme.bundle Bundle-Version: 1.2.3.v201103221001 Import-Package: javax.activation, javax.persistence, org.osgi.framework;version=”[1.3,2)” Export-Package: com.acme.bundle.service;version=2.3, com.acme.api; version=45.2 Bundle-License: http://www.apache.org/license/ASL2.0.txt Tool: bnd-1.43.0donderdag 24 maart 2011
  41. 41. Manifest Manifest-Version: 1 Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.acme.bundle Bundle-Version: 1.2.3.v201103221001 Import-Package: d javax.activation, javax.persistence, org.osgi.framework;version=”[1.3,2)” bn Export-Package: com.acme.bundle.service;version=2.3, com.acme.api; version=45.2 Bundle-License: http://www.apache.org/license/ASL2.0.txt Tool: bnd-1.43.0donderdag 24 maart 2011
  42. 42. bundle com.acme.abc-1.2.3 package com.acme.abc package com.acme.def Bundles Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } } bundle com.acme.def-9.9.1 package com.acme.abc package com.acme.ghi Class A int shared; Class B int shared; Class A int shared; Class B int shared; void foo() { void bar() { void foo() { void xyz() { void foo() { void bar() { void foo() { void xyz() { int local int local int local int local int local int local int local int local global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; global = shared; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; for (local=0; local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local local<10; local ++) ++) ++) ++) ++) ++) ++) ++) shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; shared *= 10; } } } } } } } }donderdag 24 maart 2011
  43. 43. bundle com.acme.abc-1.2.3 Bundles bundle com.acme.def-9.9.1donderdag 24 maart 2011
  44. 44. bundle com.acme.abc-1.2.3 Bundles ed ifi bundle com.acme.def-9.9.1 redonderdag 24 maart 2011
  45. 45. POJO Programming is Best Practicedonderdag 24 maart 2011
  46. 46. Interfaces/API Consumer Provider Interface Class Classdonderdag 24 maart 2011
  47. 47. Interfaces/API package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Classdonderdag 24 maart 2011
  48. 48. Interfaces/API package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Class Your Appdonderdag 24 maart 2011
  49. 49. Interfaces/API package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Class Your App DocumentBuilderdonderdag 24 maart 2011
  50. 50. Interfaces/API package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Class Your App DocumentBuilder Xercesdonderdag 24 maart 2011
  51. 51. Access to Implementations package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Classdonderdag 24 maart 2011
  52. 52. Access to Implementations package com.consumer.impl package com.api package com.provider.impl Consumer Provider Interface Class Classdonderdag 24 maart 2011
  53. 53. Access to Implementations package com.consumer.impl package com.api package com.provider.impl te Consumer Provider Interface iva Class Classdonderdag 24 maart 2011 pr
  54. 54. Access to Implementations package com.consumer.impl com.consumer.impl package com.api com.api package com.provider.impl com.provider.impl Consumer Con- Provider Interface Provider sumer Class Classdonderdag 24 maart 2011
  55. 55. µServicesdonderdag 24 maart 2011
  56. 56. µServices package com.api specifiesdonderdag 24 maart 2011
  57. 57. µServices package com.api bundle com.provider.impl specifiesdonderdag 24 maart 2011
  58. 58. µServices package com.api bundle com.provider.impl specifies providesdonderdag 24 maart 2011
  59. 59. µServices package com.api bundle bundle com.consumer.impl com.provider.impl specifies providesdonderdag 24 maart 2011
  60. 60. µServices package com.api bundle bundle com.consumer.impl com.provider.impl refers specifies providesdonderdag 24 maart 2011
  61. 61. Trivial To Use With DS package com.consumer.impl; @Component public class Consumer { Interface service; @Activate void begin(); @Reference void setLog( Interface service) { this.service = service; } } package com.provider.impl; @Component public class Provider implements Interface { public void method() { … // do something } }donderdag 24 maart 2011
  62. 62. µServices factory bundle bundle com.consumer.impl com.provider.impldonderdag 24 maart 2011
  63. 63. µServices bundle bundle com.consumer.impl com.provider.impl listenersdonderdag 24 maart 2011
  64. 64. µServices bundle bundle com.consumer.impl com.provider.impl listeners “Whiteboard”donderdag 24 maart 2011
  65. 65. µServices bundle bundle com.consumer.impl com.provider.impl listeners “Whiteboard”donderdag 24 maart 2011
  66. 66. µServices bundle com. provider.impl bundle com.consumer.impl bundle com.other. impldonderdag 24 maart 2011
  67. 67. µServices bundle bundle com. com. consumer. provider.impl impl bundle bundle com.other. com.other. consumer. provider.impl impldonderdag 24 maart 2011
  68. 68. µServices bundle bundle com. ed com. consumer. provider.impl impl bundle com.other. ifi bundle re com.other. consumer. provider.impl impldonderdag 24 maart 2011
  69. 69. Service Specifications condpermadmin permission admin measurement url service hooks position bundle hooks info.dmtree xml application blueprint jpa persistence cm component web applications deployment admin device JDBC event http sca configuration io log Blueprint metatype monitor mobile prefs provisioning tracker remote service admin UPNP coordinator user admin wire admin jndi cdma gsm transactions JMX autoconfdonderdag 24 maart 2011
  70. 70. OSGi • Next generation of strong modularity in Bundles • Imports and Exports Packages • Extensive support for legacy use cases • Communicates via µServices • Dynamic Binding • Unifies Factories, Listeners, Brokers, DI • Bundles and Services are all reified with small but powerful API • Security • Provides growing library of standard servicesdonderdag 24 maart 2011
  71. 71. JAX London London jaxlondon.com 11-13 April 2011donderdag 24 maart 2011
  72. 72. Join us ! JAX London London jaxlondon.com 11-13 April 2011donderdag 24 maart 2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×