14. The Loan Sample and OSGi

In the Colocate Exceptions pattern, we created a simple loan system. In this chapter, we look at the modules in the Loan system, refactor them into OSGi bundles, and then deploy them to an OSGi environment. You may be surprised at how easy it is to take a system with a modular design and leverage the advantages of a modularity framework like OSGi. As you’ll see, because we already had a modular software system, not a single coding change is necessary to take advantage of OSGi.

14.1. Getting Started

Figure 14.1 illustrates the classes and modules in the final structure of our loan system from the Colocate Exceptions “Sample” section. The immediate goal is to refactor these modules so that they’ll execute in an OSGi ...

Get Java Application Architecture: Modularity Patterns with Examples Using OSGi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.