Modular Java: Creating Flexible Applications with Osgi and Spring (Pragmatic Programmers)

By Craig Walls

Attack complexity on your Java purposes utilizing Modular Java. This pragmatic advisor introduces you to OSGi and Spring Dynamic Modules, of the main compelling frameworks for Java modularization. pushed by means of real-world examples, this ebook will equip you with the information you want to boost Java functions which are composed of smaller, loosely coupled, hugely cohesive modules.

the key weapon for attacking complexity in any venture is to damage it down into smaller, cohesive, and extra simply digestible items. With Modular Java, you could simply enhance purposes which are extra versatile, testable, maintainable, and comprehensible.

Modular Java is a practical consultant to constructing modular functions utilizing OSGi, the framework for dynamic modularity in Java, and Spring Dynamic Modules, an OSGi extension to the Spring Framework. you will begin with the fundamentals yet fast ramp up, growing loosely coupled modules that submit and devour providers, and you can see find out how to compose them into greater purposes. alongside the best way, you will follow what you examine as you construct a whole internet software that's made of a number of OSGi modules, utilizing Spring-DM to twine these modules together.

Modular Java is full of assistance and methods that may make you a more adept OSGi and Spring-DM developer. built with the information won from this publication, one can boost functions which are extra strong and agile.

Show description

Quick preview of Modular Java: Creating Flexible Applications with Osgi and Spring (Pragmatic Programmers) PDF

Show sample text content

Let’s begin by way of constructing a brand new package deal undertaking. establishing an online package undertaking step one towards making a internet package deal is identical first step as with all different package deal. We needs to create the package venture. So, from in the top-level listing of the Dude venture, we’ll once more use pax-create-bundle to establish a skeleton package undertaking. dwmjs% pax-create-bundle -p dwmj. internet -n net -g com. dudewheresmyjar \ 143 D EVELOPING A W EB B UNDLE ? [INFO] ... [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] dwmjs% -v 1.

Version} src/main/assembly/assembly. xml 174 D ISTRIBUTING THE A PPLICATION via basing the distribution pom. xml at the provisioning pom. xml ➊, the distribution venture will inherit the entire dependencies from the provisioning pom. xml. that would cause them to to be had to the meeting plugin for placement in a distribution zip dossier. yet that won’t be sufficient.

0-SNAPSHOT -----------------------------------------------------------------------BUILD profitable -----------------------------------------------------------------------Total time: four seconds entire at: Fri Mar 20 20:39:42 CDT 2009 ultimate reminiscence: 9M/16M ------------------------------------------------------------------------ the internet extender package deal in basic terms watches for warfare bundles to be put in within the OSGi framework. For the genuine work—deploying the struggle to an online box and making a Spring program context—the extender delegates to sessions contained in a separate Spring-DM net aid package deal.

However the major factor to keep in mind here's that IndexServiceImpl makes heavy use of Compass and the area bundle’s JarFile type. which means this package deal might want to import the programs from these bundles in its happen. And we’ll have to upload these bundles to the project’s pom. xml dossier in order that their sessions should be to be had at assemble time. the good news is that Pax Construct’s Maven plugin will immediately upload the Import-Package: headers that we want once we construct the package. yet we’ll nonetheless have to upload the dependencies to the pom.

Zero. 2) : 12237 bytes @ [ 108kBps ] -> Execution surroundings [J2SE-1. five] -> beginning platform [Felix 1. 2. 2]. Runner has effectively comprehensive his activity! Welcome to Felix. ================= -> fifty five S ETTING U P THE P ROJECT As you will see that, pax-provision fires up Felix. the major factor to note is the road that says “No bundles discovered! ” That’s simply because we haven’t created any bundles in our venture but. We’ll get to that quickly. yet first, i assumed you are drawn to seeing a number of ways in which the venture could be personalized.

Download PDF sample

Rated 4.49 of 5 – based on 42 votes