blob: 4cd0fc286bc13b1af1a2747badef9454b0598120 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter&nbsp;5.&nbsp;Migrating to OSGi</title><meta content="DocBook XSL Stylesheets V1.76.0" name="generator"><link rel="home" href="index.html" title="Virgo Programmer Guide"><link rel="up" href="index.html" title="Virgo Programmer Guide"><link rel="prev" href="ch04s10.html" title="Application Versioning"><link rel="next" href="ch05s02.html" title="Migrating to a Plan or a PAR"></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="ch04s10.html">Prev</a>&nbsp;</td><th align="center" width="60%">&nbsp;</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="ch05s02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&nbsp;5.&nbsp;Migrating to OSGi"><div class="titlepage"><div><div><h2 class="title"><a name="migrating-to-osgi"></a>Chapter&nbsp;5.&nbsp;Migrating to OSGi</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch05.html#migrating-to-osgi-web">Migrating Web Applications</a></span></dt><dd><dl><dt><span class="section"><a href="ch05.html#migrating-to-osgi-web-standard-war">Standard WAR</a></span></dt><dt><span class="section"><a href="ch05.html#migrating-to-osgi-web-shared-libraries-war">Shared Libraries WAR</a></span></dt><dt><span class="section"><a href="ch05.html#migrating-to-osgi-web-shared-services-war">Shared Services WAR</a></span></dt><dt><span class="section"><a href="ch05.html#migrating-to-osgi-web-summary">Web Migration Summary</a></span></dt></dl></dd><dt><span class="section"><a href="ch05s02.html">Migrating to a Plan or a PAR</a></span></dt><dd><dl><dt><span class="section"><a href="ch05s02.html#migrating-to-osgi-parplan-bundles">Creating the Application Bundles</a></span></dt><dt><span class="section"><a href="ch05s02.html#migrating-to-osgi-parplan-decide">Plan or PAR?</a></span></dt></dl></dd></dl></div><p>
Taking on a new technology such as OSGi may seem a bit daunting at first,
but a proven set of migration steps can help ease the journey. Teams
wishing to migrate existing applications to run on the Virgo Server for Apache Tomcat
will find that their applications typically fall into one of the following
categories.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<span class="bold"><strong>Web Application</strong></span>: for web applications,
this chapter provides an overview of the steps required to migrate
from a Standard WAR to a Shared Services WAR. Furthermore, the following
chapter provides a detailed case study involving the migration
of the Spring 3.0 Form Tags show case application.
</p></li><li class="listitem"><p>
<span class="bold"><strong>Anything else</strong></span>: for any other type
of application, you will typically either deploy your application
as multiple individual bundles, as a single PAR file, or as a plan,
which is the recommended approach for deploying applications on
the Virgo Server for Apache Tomcat. See <a class="xref" href="ch05s02.html" title="Migrating to a Plan or a PAR">Migrating to a Plan or a PAR</a> for details.
</p></li></ul></div><p>
</p><div class="section" title="Migrating Web Applications"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="migrating-to-osgi-web"></a>Migrating Web Applications</h2></div></div></div><p>
Many applications may start with the standard WAR format for web applications and
gradually migrate to a more OSGi-oriented architecture. Since the Virgo Server for Apache Tomcat
offers several benefits to all supported deployment formats, it provides a smooth
migration path. Of course, depending on your application&rsquo;s complexity and your
experience with OSGi, you may choose to start immediately with an OSGi-based
architecture.
</p><div class="section" title="Standard WAR"><div class="titlepage"><div><div><h3 class="title"><a name="migrating-to-osgi-web-standard-war"></a>Standard WAR</h3></div></div></div><p>
If you are not yet familiar with OSGi or simply want to deploy an existing web application on the Virgo Server for Apache Tomcat,
you can deploy a standard WAR and leverage the VTS with a minimal learning curve. In fact reading the
<a class="ulink" href="../../virgo-user-guide/html/index.html" target="_top">Virgo Server for Apache Tomcat User Guide</a>
is pretty much all that you need to do to get started. Furthermore, you will gain
familiarity with the Virgo Server for Apache Tomcat, while preparing to take advantage of the other formats.
</p></div><div class="section" title="Shared Libraries WAR"><div class="titlepage"><div><div><h3 class="title"><a name="migrating-to-osgi-web-shared-libraries-war"></a>Shared Libraries WAR</h3></div></div></div><p>
The <span class="emphasis"><em>Shared Libraries WAR</em></span>
format is the first step to reaping the benefits of OSGi. In this phase, you dip your toes into OSGi-based dependency
management by removing JAR files from the WAR and declaring dependencies on corresponding OSGi bundles.
</p></div><div class="section" title="Shared Services WAR"><div class="titlepage"><div><div><h3 class="title"><a name="migrating-to-osgi-web-shared-services-war"></a>Shared Services WAR</h3></div></div></div><p> In this phase, you take the next step toward a fully OSGi-based architecture by separating your web artifacts
(e.g., Servlets, Controllers, etc.) from the services they depend on.</p></div><div class="section" title="Web Migration Summary"><div class="titlepage"><div><div><h3 class="title"><a name="migrating-to-osgi-web-summary"></a>Web Migration Summary</h3></div></div></div><p>
The following diagram graphically depicts the migration path from a Standard WAR to a Shared Services WAR.
As you can see, the libraries (<span class="emphasis"><em>libs</em></span>) move from within the deployment artifact
to the Bundle Repository.
Similarly, the services move from within the WAR to external bundles and are accessed via the
OSGi Service Registry. In addition, the overall footprint of the deployment artifact decreases
as you move towards a Shared Services WAR.
</p><div class="mediaobject"><img src="images/migration-path-war-to-shsrv.png"></div><p>
</p></div></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="ch04s10.html">Prev</a>&nbsp;</td><td align="center" width="20%">&nbsp;</td><td align="right" width="40%">&nbsp;<a accesskey="n" href="ch05s02.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;</td></tr></table></div></body></html>