| <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Spring DM and Blueprint Concepts</title><meta content="DocBook XSL Stylesheets V1.76.0" name="generator"><link rel="home" href="index.html" title="Virgo User Guide"><link rel="up" href="ch02.html" title="Chapter 2. Concepts"><link rel="prev" href="ch02s02.html" title="OSGi Concepts"><link rel="next" href="ch02s04.html" title="Virgo Concepts"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><td align="left" width="20%"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th align="center" width="60%"> </th><td align="right" width="20%"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr></table><hr></div><div class="section" title="Spring DM and Blueprint Concepts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="concepts.springdm"></a>Spring DM and Blueprint Concepts</h2></div></div></div><p>Spring DM is a project which enables <span class="emphasis"><em>services</em></span> to be published and consumed |
| using descriptions written in XML.</p><p>The XML descriptions reside in files with extension <code class="literal">.xml</code> in the |
| bundle’s <code class="literal">META-INF/spring</code> sub-directory.</p><p> |
| To publish a service, an <code class="literal"><osgi:service></code> tag is used, specifying the |
| implementation class of the service and the interface class to be used. |
| Spring DM constructs an instance of the implementation class and |
| publishes that instance in the OSGi service registry under the interface when the bundle is started. |
| </p><p>To consume a service, an <code class="literal"><osgi:reference></code> tag is used and the |
| service may be passed into other Spring beans using Spring’s dependency |
| injection facilities.</p><p>Spring DM automatically creates proxies for OSGi services so that the actual service |
| object may come and go at runtime. |
| If a service disappears, any proxies to the service will wait for the service to re-appear. |
| This effect is known as <span class="emphasis"><em>damping</em></span>.</p><p>When a bundle is started, Spring DM builds the application contexts |
| specified by the XML descriptions, creates proxies for the specified services, and publishes |
| the specified services to the OSGi service registry.</p><p>When a bundle is stopped, Spring DM retracts any services it published on behalf of the bundle |
| and closes the bundle’s application contexts. |
| Virgo turns off damping of a service proxy while the proxy’s application context |
| is being closed.</p><p>Spring DM was contributed to Eclipse as the <span class="emphasis"><em>Gemini Blueprint</em></span> project. |
| Virgo has Gemini Blueprint built-in.</p><p>Gemini Blueprint supports both Spring DM and Blueprint programming models. |
| Blueprint, known formally as the "OSGi Blueprint Container", provides some of the basic facilities of Spring DM, |
| including all those just mentioned, but in an OSGi standard form. |
| See <a class="xref" href="apc.html" title="Appendix C. Further Reading">Appendix C. <i> |
| Further Reading |
| </i></a> for the Blueprint specification. |
| </p></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="ch02.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%"> </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%"> </td></tr></table></div></body></html> |