thoroughly baked support for deployment of traditional .war artifacts, enable use of some of the
standard Java EE libraries, provide useful defaults for many de-facto standard libraries, and provide fully
integrated support for Spring Dynamic Modules.
Use Spring dm Server, SpringSource's venerable OSGi-oriented server built on many technologies
including Equinox and the Spring framework itself.
OSGi is a framework, on top of which more sophisticated solutions are built. OSGi doesn't solve
framework concerns, instead focusing on infrastructure requirements for Java applications. OSGi
is a specification that is well-represented in implementations. Spring Dynamic Modules provides
functionality that sits on top of those implementations, providing very powerful runtime sophistication
for developers looking to produce and consume OSGi services in a Spring-friendly fashion.
Realizing that Spring Dynamic Modules was, while powerful for those already invested in an OSGi
platform, not the most natural accommodations for those trying to migrate large code into the OSGi
environment, SpringSource created SpringSource dm Server. SpringSource dm Server is a robust
solution. There are several editions available. The community edition is licensed under the GPL 3.0.
You may download the source code and build it yourself. SpringSource dm Server provides tooling via
Eclipse to help design solutions designed for dm Server.
SpringSource dm Server's many advances focus on delivering a solution, and not just a framework,
for delivering OSGi-based enterprise applications. The lack of support for core enterprise features stems
from OSGi's suitability for any of a number of target environments, including embedded devices. While
you are able to use OSGi-friendly HTTP servlet containers to deploy web applications, it's been up
to you to build that solution. Imagine piecing together a proper Java EE server, component by
component! Thus, SpringSource dm Server provides value above and beyond a regular OSGi solution
because it's already well-integrated.
SpringSource dm Server provides a number of features geared towards minimizing the hassle of
deploying large applications in an OSGi environment. It reduces the number of redundant jars on a
server through the use of a shared library repository, where jars shared among many other artifacts may
be stored. Significantly, this reduces the need to redeploy bundles because they are automatically loaded
from this repository. Large enterprise packages tend to be composed of a tapestry of dependencies, each
of which depends on any permutation of other dependencies. OSGi-enabling all of these interwoven
dependencies via the granular use of the Import-Package header would be tedious. Spring dm Server
provides the ability to wholesale import an entire library and all packages therein to expedite the
process. Additionally, SpringSource dm Server can effect an even more flexible isolation of services in an
OSGi environment, preventing collisions caused by deployment of the same service with the same name
without a need to use a service attribute or other discriminator.
SpringSource dm Server also allows you to bend the rules where necessary. For example, consider
the application of an aspect using Spring's AOP. This might require weaving of classes, which in the case
of a point cut that matches classes deployed across multiple bundles, would prove cumbersome.
SpringSource dm Server can intervene on Spring's behalf, propagating such changes across multiple
bundles where necessary.
SpringSource dm Server works with four types of deployment formats. The first is a bundle , which
we've discussed, and that works as you'd expect. The second is a native Java EE .war file. This is
revolutionary because it provides support for out-of-the-box deployment of legacy .WAR -based
applications. However, this format should be viewed as an intermediary step, as it loses out on many of
the advantages of OSGi. Hybrid approaches are supported; a shared-library .WAR lets you deploy a .WAR
whose dependencies are satisfied by the shared library. The server supports an enhanced format called
a web module, which is an enhanced shared-library .WAR . The format removes the need for XML