Your SlideShare is downloading. ×
Spring Dynamic Modules
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Spring Dynamic Modules


Published on

Spring Dynamic Modules: OSGi meets the Spring Framework …

Spring Dynamic Modules: OSGi meets the Spring Framework

Introductive presentation about Spring DM and OSGi presented at the Spring Framework Italian Group in Cagliari, September 2009

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

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Spring Dynamic Modules OSGi meets the Spring Framework Filippo Diotalevi <> Spring Framework Italian Meeting, Cagliari, September 12th 2009
  • 2. About OSGi and Java Enterprise consultant Java User Group Milano founder and coordinator Apache Felix committer
  • 3.
  • 4. Summary OSGi Spring Dynamic Modules for OSGi What’s next
  • 5. OSGi A dynamic module system for Java (Demo)
  • 6. Module System Clear boundaries Dependencies Metadata Lifecycle
  • 7. Lifecycle of bundle
  • 8. Service System Service Oriented Architecture in the JVM
  • 9. Service System Service Registry Register Retrieve Service Service Bundle Provider Bundle Consumer
  • 10. 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
  • 11. 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
  • 12. Why Spring DM? OSGi in NOT about user interfaces OSGi is about building modular and service oriented applications Enterprise applications need modularity and SOA
  • 13. 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
  • 14. 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
  • 15. Bundles & Spring 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
  • 16. Beans as OSGi Services <beans> <bean name="customerService" class="demo.customerservice.impl.CustomerServiceImpl"/> <osgi:service id="customerServiceOsgi" ref="customerService" interface="demo.customerservice.CustomerService"/> </beans>
  • 17. Importing OSGi services <beans> <osgi:reference id="customerServiceOsgi" interface="demo.osgi.customerservice.CustomerService"/> <bean id="orderService" class="demo.osgi.orderservice.internal.OrderServiceImpl"> <property name="customerService"> <reflocal="customerServiceOsgi"/> </property> </bean> </beans>
  • 18. Bigger picture Application Context Customer Service Expose Customer Service Service Registry Retrieve Customer Service Application Context Customer Order Service Service use Proxy
  • 19. Result (Almost) no dependencies on OSGi APIs Everything is a POJO (Spring philosophy) Improved application modularity
  • 20. Going forward Standardization: OSGi Blueprint Service Enterprise OSGi support in Spring DM Full support for Web Applications and Java EE components Integration with OSGi Remote-Services Inter-JVM services
  • 21. Questions?
  • 22.
  • 23. Images used: