Book Image

OSGi and Apache Felix 3.0 Beginner's Guide

By : Walid Joseph Gédéon
Book Image

OSGi and Apache Felix 3.0 Beginner's Guide

By: Walid Joseph Gédéon

Overview of this book

<p>The OSGi specification is a module system and service platform that implements a complete and dynamic component model. Wasn't that a complicated definition! So how would you really use it in practical modular applications? Let this book break down the seemingly overwhelming OSGi standards for you by explaining Apache Felix's powerful architecture in a simple and easy-to-understand manner using Apache Felix framework to get you up and running sooner than you could expect.<br /><br />The OSGi standards have found a wide range of applications in the context of the Enterprise, Telecommunications, Telematics, Smart Home, E-Health, and Mobile applications, to name just a few. Apache Felix is one of the most famous implementations of the OSGi framework specification. This book introduces OSGi on the simple and extensible Felix framework and guides you from the development environment setup to the troubleshooting of potential issues, walking you through the development of an OSGi-based application and explaining relevant software design concepts.<br /><br />The book starts with an introduction to the OSGi Service Platform, its parts, and its bundle structure. It then walks you through setting up the Felix framework and your development environment. It describes the Felix Framework and how to operate it using Gogo. It will teach you everything possible about the practical implementation of OSGi using the Felix Framework as a launch pad.<br /><br />The book then kicks off the Bookshelf project, a case study that will be used to progressively explain the important concepts around OSGi using the Felix framework. The Bookshelf project feature trail will set the context to explain OSGi headers, the bundle activator, the bundle context, and so on.<br /><br />As you implement the bookshelf step by step, you learn about OBR repositories, dependency management, and bundle version management with Felix.<br /><br />Moving ahead, a few more advanced topics are covered, such as using iPOJO for dependency injection and service registration; then the book moves on to the implementation of a web-based graphical interface, first using a simple Servlet, and then building a JSP-based Web Application Bundle.<br /><br />OSGi service specifications such as the Log Service, Http Service, and Web Container are explained. Finally, the book describes some of the common pitfalls during bundle development, and gives hints on troubleshooting them in Felix.</p>
Table of Contents (22 chapters)
OSGi and Apache Felix 3.0
Credits
About the Author
About the Reviewers
Preface

Importing a Maven project into Eclipse


Adding a Maven project, which already has its file structure and POM defined into Eclipse, is also easy. In this example, we'll add the bookshelf-inventory-api project into Eclipse, after having constructed it as described in Chapter 5.

To add the bookshelf-inventory-api project to Eclipse, start by launching the New Java project wizard.

When you type in the name of the project (in this case, com.packtpub.felix.bookshelf-inventory-api), the wizard will detect an existing project and gray out most of the remaining options in this pane.

Click Finish to import this project. The result is a Java project containing the files in the directory structure.

However, this project is not yet configured to be managed by the m2clipse plugin. To enable this feature, right-click on the project root and select the Maven -> Enable Dependency Management option.

The project is now associated with the Eclipse m2clipse plugin. To make it refresh its configuration based on the existing pom.xml, right-click on the project root and select the Maven -> Update Project Configuration:

This will ask the m2 plugin to refresh the project's configuration, based on its POM.