• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Spring Dynamic Modules

Spring Dynamic Modules



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



Total Views
Views on SlideShare
Embed Views



6 Embeds 198

http://www.jugsardegna.org 139
http://www.slideshare.net 19
http://www.knokode.com 18
http://www.linkedin.com 11
http://knokode.com 10
https://www.linkedin.com 1



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.

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

    Spring Dynamic Modules Spring Dynamic Modules Presentation Transcript

    • Spring Dynamic Modules OSGi meets the Spring Framework Filippo Diotalevi <filippo@diotalevi.com> Spring Framework Italian Meeting, Cagliari, September 12th 2009
    • About OSGi and Java Enterprise consultant Java User Group Milano founder and coordinator Apache Felix committer http://www.diotalevi.com filippo@diotalevi.com
    • http://www.osgilook.com http://www.jaxitalia.com
    • Summary OSGi Spring Dynamic Modules for OSGi What’s next
    • OSGi A dynamic module system for Java (Demo)
    • Module System Clear boundaries Dependencies Metadata Lifecycle
    • Lifecycle of bundle
    • Service System Service Oriented Architecture in the JVM
    • Service System Service Registry Register Retrieve Service Service Bundle Provider Bundle Consumer
    • 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
    • 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
    • Why Spring DM? OSGi in NOT about user interfaces OSGi is about building modular and service oriented applications Enterprise applications need modularity and SOA
    • 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
    • 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
    • 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
    • Beans as OSGi Services <beans> <bean name="customerService" class="demo.customerservice.impl.CustomerServiceImpl"/> <osgi:service id="customerServiceOsgi" ref="customerService" interface="demo.customerservice.CustomerService"/> </beans>
    • 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>
    • Bigger picture Application Context Customer Service Expose Customer Service Service Registry Retrieve Customer Service Application Context Customer Order Service Service use Proxy
    • Result (Almost) no dependencies on OSGi APIs Everything is a POJO (Spring philosophy) Improved application modularity
    • 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
    • Questions?
    • http://www.osgilook.com http://www.jaxitalia.com
    • Images used: http://www.flickr.com/photos/etringita/2722410302/ http://www.sxc.hu/photo/1124847 http://www.sxc.hu/photo/1222662 http://www.sxc.hu/photo/1038332 http://www.sxc.hu/photo/1039992 http://www.sxc.hu/photo/994582