µServices for the rest of us - karl pauls
Upcoming SlideShare
Loading in...5
×
 

µServices for the rest of us - karl pauls

on

  • 3,248 views

Many people are drawn into OSGi because it provides class loaders on steroids, however, one of the often overlooked feature of OSGi is the Service Registry and the (µ)service model. µServices ...

Many people are drawn into OSGi because it provides class loaders on steroids, however, one of the often overlooked feature of OSGi is the Service Registry and the (µ)service model. µServices provide a much more powerful alternative to the traditional Java factories and listeners in your code or xml, which are the usual culprits for class loading headaches. Alas, you need to migrate your application to OSGi first in order to take advantage of µServices which would make it so much easier to migrate your application to OSGi in the first place. The idea of PojoSR (a.k.a OSGi Lite) is to remedy this situation by providing OSGi without the module layer. PojoSR is based on Apache Felix and runs in any standard Java environment: from the class path, inside a WAR, wherever your current Java runs because it never touches a class loader. It allows any application built in Java to reap the benefits of service-based modularity without first having to rid existing code of any class loader tricks. This approach also allows, many existing bundles work out of the box - just by adding them to the class path (PojoSR will detect bundles on the class path and execute their activators). It works so well that OSGi is thinking of standardizing this approach. This talk will show you how you can take advantage of µServices using PojoSR and present some examples where µServices and PojoSR wore used to modularize and OSGi'fy an existing application.

Statistics

Views

Total Views
3,248
Views on SlideShare
3,248
Embed Views
0

Actions

Likes
4
Downloads
121
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

µServices for the rest of us - karl pauls µServices for the rest of us - karl pauls Presentation Transcript

  • µServices For the Rest of UsKarl PaulsLuminis21.09.2011, 12:40-13:30 OSGi Alliance Marketing © 2008-2010 . 1 PageCOPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved All Rights Reserved
  • Karl• Member Apache Software Foundation • PMC: Felix, Sling, Incubator • PPMC: Ace, Clerezza, Celix• Fellow at Luminis• Project Owner PojoSR• Co-Author of “OSGi in Action”• karl.pauls@luminis.eu• karlpauls@gmail.com Page 2 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • Luminis http://luminis.eu http://luminis-technologies.com Page 3 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • HISTORY Page 4 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Agenda• OSGi bootcamp• OSGi µServices• µServices For the Rest of Us• Use Cases• Implementation / Demo• Closing Remarks Page 5 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • OSGiBOOTCAMP Page 6 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • OSGi bootcamp Page 7 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Define Modules ... Page 8 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • ... Compose Modules ... Page 9 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • ... with OSGi • L3 – Provides publish/find/bind service service model to decouple bundles • L2 – Manages the life cycle of life cycle bundle in a bundle cache without requiring restarts • L1 – Creates the concept of module bundles that use classes from each other in a controlled way Page 10 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • OSGiµSERVICES Page 11 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 12 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 13 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 14 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 15 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 16 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 17 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • WHITEBOARDPage 19 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • EXTENDERPage 20 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • SERVICE COMPONENTS Page 21 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • OSGiµSERVICES FOR THE REST OF US Page 22 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 23 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 24 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 25 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 26 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 27 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • OR CAN YOU? Page 28 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • PojoSR (a.k.a OSGi Lite a.k.a lite a.k.a ???)• OSGi µServices For the Rest of Us • OSGi without the module layer • Based on Apache Felix • Runs in standard Java environment • Doesn‘t create class loaders • Apache License 2• Exposes Service Registry to normal Java • No need for bundles • But bundles are supported up to a point • Missing module layer Page 29 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • USE CASES Page 30 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Common discovery (SPI) Page 31 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 32 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Migration Page 33 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Migration with and without PojoSR• Start using Service first! • Split into bundles later and work on trunk!• Without PojoSR • Turn application into one big bundle • Split into several bundles • Fix problems • Split even more bundles (goto split) • Eventually, start using services • Allows to remove ugly hacks and crazy meta-data needed to fix problems Page 34 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Use OSGi where you can‘t OSGi (lite) on Google App Engine using PojoSRPage 35 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • USAGEPage 36 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Page 37 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • As an OSGi „light“ framework Page 38 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Standalone Page 39 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • IMPLEMENTATION Page 40 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • • Classloader.getResources(META- INF/MANIFEST.MF) • Find bundle on the classpath• Provide Bundle Revision based on jar: and file: url schemas (extendable)• Use and expose Apache Felix service registry for the rest Page 41 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • DEMOPage 42 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • CLOSING REMARKS Page 43 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • Benefits and Drawbacks• PojoSR provides part of the power of OSGi • In a non-intrusive way. • Allows to increase modularity • without first ridding an existing code base of class loader hacks• Drawbacks are • Does not enforce module boundaries • Does not allow multiple versions of the same package • and other module layer features (so some are supported) • Not support the Bundle-Classpath • But you can use µServices to get rid of class loading hacks over time, after which it will be easier to move to OSGi and get side by side versioning and real module boundaries. Page 44 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • http://pojosr.googlecode.comQUESTIONS Page 45 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved