Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
OSGi - Basics  Runtime modular Java       Lifecycle handling of          individual bundles       Class-loading       Vers...
Java class visibilityjar (A)                                                   jar (B) com.rl.log.api                     ...
OSGi visibility       bundle (A)     Bundle-Version: 1.2.3                      bundle (B)       Import-Package:          ...
Traditional vs OSGi classloading Traditional (extremely simplified...)                                         OSGi       ...
Bundle lifecycleosgi:install    deploys bundleosgi:startosgi:stoposgi:update    uninstall → install →      resolve → resta...
Services                get()                               register()Consumer                     Service                ...
Implementations  Apache Felix (ASF)                                                                ServiceMix / Karaf  Equ...
The ServiceMix runtimeServiceMix / Fuse ESB        CXF                  Camel                   ActiveMQKaraf     Shell   ...
Upcoming SlideShare
Loading in …5
×

03 osgi and servicemix

1,134 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

03 osgi and servicemix

  1. 1. OSGi - Basics Runtime modular Java Lifecycle handling of individual bundles Class-loading Versioning Depency management Been around since 1999PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  2. 2. Java class visibilityjar (A) jar (B) com.rl.log.api com.rl.app com.rl.log.impl com.rl.util PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  3. 3. OSGi visibility bundle (A) Bundle-Version: 1.2.3 bundle (B) Import-Package: Export: com.rl.api;v=1.2.3 com.rl.api;v=[1,2) com.rl.log.api com.rl.app com.rl.log.impl com.rl.utilOSGi adds restrictions on a module-level basis to each deployable unit (bundle).A bundle however is nothing more than a JAR with added meta-data in MANIFEST.MF PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  4. 4. Traditional vs OSGi classloading Traditional (extremely simplified...) OSGi ClassLoader ClassLoader A ClassLoader A C.1 (Loads class A) (Loads class A) (Loads class Sees: A, C.1) Sees: C.1, Sees: A (C.1) (D) ClassLoader D ClassLoader B (Loads class (Loads class B) D) Sees: A,B Sees: D ClassLoader ClassLoader X ClassLoader Y ClassLoader B C.2(Loads class X) (Loads class Y) (Loads class B) (Loads class C.2)Sees: A,B,X Sees: B, Sees: C.2, Sees: A,B,Y (C.2) (D) * - Imported bundles classes are actually loaded from delegated classloader PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  5. 5. Bundle lifecycleosgi:install deploys bundleosgi:startosgi:stoposgi:update uninstall → install → resolve → restartosgi:refresh rewire package dep. PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  6. 6. Services get() register()Consumer Service ImplementerBundle Bundle listen() Listener BundlePRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  7. 7. Implementations Apache Felix (ASF) ServiceMix / Karaf Equinox (Eclipse) KnoplerfishPRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  8. 8. The ServiceMix runtimeServiceMix / Fuse ESB CXF Camel ActiveMQKaraf Shell Security Provisioning Karaf features Logging ConfigAdmin Deploy Spring DM Dependency injection Blueprint (Spring OSGi (optional) (Apache Aries) ext) Equinox Felix OSGi container PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING

×