文档介绍:OSGi and Apache Felix
Beginner’s Guide
Copyright © 2010 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly
or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2010
Production Reference: 1291010
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849511-38-4
Cover Image by John M. Quick (@)
Table of Contents
Preface 1
Chapter 1: Quick Intro to Felix and OSGi 7
What is OSGi? 8
The framework layout 10
The functional layers 10
The bundle lifecycle states 12
Bundle wiring 13
The shared service registry 14
Working with bundles 15
Anatomy of a bundle 15
The OSGi headers 16
Mandatory headers 16
Functional headers 17
Information headers 18
Start levels 18
The Start Level Service 18
The active start level 18
Using start levels 20
Apache Felix and sub-projects 21
Summary 24
Chapter 2: Setting Up the Environment 25
Setting up the Felix framework 25
Checking that a JDK is installed 26
Download and unpack the Felix distribution 27
Time for action – downloading and installing Felix 27
What's in the box? 28
Time