OSGi in the Enterprise

6,432 views

Published on

Using OSGi in enterprise applications: technologies, motivations, case studies.
Presented at JaxItalia 2009, Milano, October 13th 2009

Published in: Technology, Education
0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,432
On SlideShare
0
From Embeds
0
Number of Embeds
134
Actions
Shares
0
Downloads
358
Comments
0
Likes
10
Embeds 0
No embeds

No notes for slide

OSGi in the Enterprise

  1. 1. OSGi in the Enterprise Filippo Diotalevi Knokode Ltd filippo@diotalevi.com
  2. 2. About OSGi and Java Enterprise consultant Java User Group Milano founder and coordinator Apache Felix committer http://www.osgilook.com http://www.diotalevi.com filippo@diotalevi.com OSGi in the Enterprise - Filippo Diotalevi
  3. 3. Summary OSGi OSGi in the Enterprise Case Studies OSGi - A developer’s quiickstart Saturday 11.30 - 12.00 OSGi in the Enterprise - Filippo Diotalevi
  4. 4. OSGi A dynamic module system for Java OSGi in the Enterprise - Filippo Diotalevi
  5. 5. OSGi 1999 - OSGi Alliance founded, JSR 8 2000 - R1 published 2003 - Eclipse choose OSGi for the plugin architecture 2007 - R4.1 published (JSR 291) 2009 - R4.2 published 2010 - Enterprise OSGi OSGi in the Enterprise - Filippo Diotalevi
  6. 6. OSGi 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 OSGi in the Enterprise - Filippo Diotalevi
  7. 7. OSGi Building system from smaller components Components working together Managing components OSGi in the Enterprise - Filippo Diotalevi
  8. 8. OSGi Service Layer Lifecycle Layer Module Layer OSGi in the Enterprise - Filippo Diotalevi
  9. 9. Module System Clear boundaries Dependencies Metadata Lifecycle OSGi in the Enterprise - Filippo Diotalevi
  10. 10. Lifecycle of bundle OSGi in the Enterprise - Filippo Diotalevi
  11. 11. Service System Service Oriented Architecture in the JVM OSGi in the Enterprise - Filippo Diotalevi
  12. 12. Service System Service Registry Register Retrieve Service Service Bundle Provider Bundle Consumer OSGi in the Enterprise - Filippo Diotalevi
  13. 13. What’s an OSGi Application? A collection of bundles interacting via Service interfaces Bundles developed and installed independently Bundle and services can appear and disappear OSGi in the Enterprise - Filippo Diotalevi
  14. 14. Demo OSGi in the Enterprise - Filippo Diotalevi
  15. 15. What’s behind the demo Register Service Circle Registry Register Bundle Circle Listen for Triangle and Provide the Circle retrieve implementation Shapes Bundle Host Bundle Triangle Provide the Frame and Provide the Triangle define the Shape interface implementation OSGi in the Enterprise - Filippo Diotalevi
  16. 16. OSGi in the Enterprise Why? Create modular and reusable software Create evolvable software Create line of products OSGi in the Enterprise - Filippo Diotalevi
  17. 17. OSGi in the Enterprise What? Desktop Applications Web Applications Service Layers Content Management System Embedded/Mobile Applications Cloud Applications OSGi in the Enterprise - Filippo Diotalevi
  18. 18. Examples: OSGi in the Enterprise - Filippo Diotalevi
  19. 19. OSGi in the Enterprise How? Desktop Applications Eclipse Rich Client Platform OSGi in the Enterprise - Filippo Diotalevi
  20. 20. OSGi in the Enterprise How? Web Applications Apache Sling Spring Dynamic Modules Apache Felix Karaf + Pax Web (Jetty) OSGi in the Enterprise - Filippo Diotalevi
  21. 21. Spring Dynamic Modules Part of the Spring open source portfolio Formerly known as Spring-OSGi Works with every OSGi container Allows you to implement Spring applications on top of any OSGi framework OSGi in the Enterprise - Filippo Diotalevi
  22. 22. Spring DM idea Application Application Context Context Bundle B Bundle A Application Context Bundle C Spring + Spring DM Imported Service Exported Service OSGi Container Spring Bean Java Virtual Machine OSGi in the Enterprise - Filippo Diotalevi
  23. 23. Spring vs OSGi One application context per bundle When a bundle is started, its application context is discovered and instantiated Bundles can export Spring beans as OSGi services Bundles can import OSGi services OSGi in the Enterprise - Filippo Diotalevi
  24. 24. Blueprint Service Blueprint, dependency injection a-la-Spring Apache Geronimo Blueprint (may change in the future...) OSGi in the Enterprise - Filippo Diotalevi
  25. 25. OSGi in the Enterprise How? Service Layers Spring Dynamic Modules Apache Felix Apache Servicemix OSGi Remote Services OSGi in the Enterprise - Filippo Diotalevi
  26. 26. Coming soon... Enterprise OSGi Full Web Application Support (RFC 66) JDBC integration JNDI/LDAP integration ..... look for Apache Aries (http://incubator.apache.org/aries) OSGi in the Enterprise - Filippo Diotalevi
  27. 27. OSGi in the Enterprise Challenges and Opportunities Modular Design Development process and tools Quality Assurance Versioning and Dynamic Updates Provisioning OSGi in the Enterprise - Filippo Diotalevi
  28. 28. Case Studies OSGi in the Enterprise - Filippo Diotalevi
  29. 29. Case Study 1: Service Layer Goal Create a service layer where services - can be deployed/updated at runtime without causing service disruptions - can be customized for specific customers - (possibly) reusing some existing components OSGi in the Enterprise - Filippo Diotalevi
  30. 30. Case Study 1: Service Layer Solution: architecture Embedded Jetty Server Generic REST API POJO -> XML transformation Weather News Service Service Spring DM Spring OSGi in the Enterprise - Filippo Diotalevi
  31. 31. Case Study 1: Service Layer Solution: evolution Generic REST API News Weather News Service Twitter Service Service V.2 (BBC only) OSGi in the Enterprise - Filippo Diotalevi
  32. 32. Case Study 1: Service Layer Lessons learned “Right” modularization is hard, and there is no fixed rule Spring DM gets developers back in their confort zone (and hides OSGi APIs) Deployment loves it (dynamicity, console, modularity) OSGi in the Enterprise - Filippo Diotalevi
  33. 33. Case Study 2: OSGi in the Cloud Goal Manage completely the deployment of a Web Application in a cluster of Amazon virtual machines Applications are modular, modules can be updated without causing service disruption OSGi in the Enterprise - Filippo Diotalevi
  34. 34. Case Study 2: OSGi in the Cloud Goal “Cloud console” ? OSGi in the Enterprise - Filippo Diotalevi
  35. 35. Case Study 2: OSGi in the Cloud Amazon Elastic Load Balancer Solution: architecture ELB Start Start WebConsole Provision (SSH) EC2 Load Upload Amazon EC2 Cluster Define packages Web Application based on Apache Felix Karaf Bundle Start Repository EBS/ RDS MySQL (Amazon EBS or RDS) OSGi in the Enterprise - Filippo Diotalevi
  36. 36. Case Study 2: OSGi in the Cloud OSGi in the Enterprise - Filippo Diotalevi
  37. 37. Case Study 3: Float management Goal Manage a float of Java-enabled devices - check the software installed - push software updates OSGi in the Enterprise - Filippo Diotalevi
  38. 38. Case Study 3: Float management Solution: Apache ACE OSGi in the Enterprise - Filippo Diotalevi
  39. 39. Conclusion OSGi is an enabling technology that opens up new opportunities OSGi in the Enterprise - Filippo Diotalevi
  40. 40. Questions? OSGi in the Enterprise - Filippo Diotalevi

×