Spring Dynamic Modules Reference Guide

Authors

Adrian M Colyer (SpringSource) , Hal Hildebrand (Oracle) , Costin Leau (SpringSource) , Andy Piper (BEA)

2.0.0.M1

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Preface
I. Introduction
1. Why Spring Dynamic Modules?
2. Requirements
3. Getting Started
3.1. First Steps
3.1.1. Knowing Spring
3.1.2. Knowing OSGi
3.1.3. Quick start - OSGi 4.2 Blueprint Container
3.1.4. Trying Out The Samples
3.2. Need Help?
3.2.1. Community Support
3.2.2. Professional Support
3.3. Following Development
4. What is new?
4.1. 2.0.x
4.1.1. OSGi 4.2 Blueprint Reference Implementation (RI)
4.1.2. Java 5
4.1.3. Spring 3.x
4.1.4. Service Importer Improvements
4.1.5. Java 2 Security Integration
4.2. 1.2.x
4.2.1. Java 2 Security Integration
4.2.2. Compendium Services Support
4.2.3. Changed Spring DM Symbolic Names
4.2.4. Usage of SpringSource Enterprise Bundle Repository (EBR)
4.3. 1.1.x
4.3.1. Web Support
4.3.1.1. Spring-MVC Integration
4.3.2. Classpath Resource Abstraction
4.3.3. Pluggable Extender Configuration
4.3.4. Improved Class Loading
II. Reference Documentation
5. OSGi 4.2 Blueprint Container
5.1. Blueprint Requirements
5.2. Blueprint/Spring DM Differences
5.2.1. XML Declarations
5.2.2. Container Capabilities
5.3. Using Blueprint
6. Bundles and Application Contexts
6.1. The Spring Dynamic Modules Extender Bundle
6.2. Application Context Creation
6.2.1. Mandatory Service Dependencies
6.2.2. Application Context Service Publication
6.3. Bundle Lifecycle
6.4. The Resource Abstraction
6.5. Bundle Scope
6.6. Accessing the BundleContext
6.7. Application Context Destruction
6.8. Stopping the Extender Bundle
7. Packaging and Deploying Spring-based OSGi applications
7.1. Bundle Format And Manifest Headers
7.2. Blueprint Manifest Configuration Comparison
7.3. Extender Configuration Options
7.3.1. Listening To Extender Events
7.4. Required Spring Framework And Spring Dynamic Modules Bundles
7.5. Spring XML Authoring Support
7.6. Importing and Exporting Packages
7.7. Considerations When Using External Libraries
7.8. Diagnosing Problems
8. The Service Registry
8.1. Exporting A Spring Bean As An OSGi Service
8.1.1. Using The Service Registration
8.1.2. org.osgi.framework.ServiceFactory Support
8.1.3. Controlling The Set Of Advertised Service Interfaces For An Exported Service
8.1.3.1. Detecting The Advertised Interfaces At Runtime
8.1.4. Controlling The Set Of Advertised Properties For An Exported Service
8.1.5. The depends-on Attribute
8.1.6. The context-class-loader Attribute
8.1.7. The ranking Attribute
8.1.8. The cache-target Attribute
8.1.9. service Element Attributes
8.1.10. Service Registration And Unregistration Lifecycle
8.1.10.1. Using OsgiServiceRegistrationListener Interface
8.1.10.2. Blueprint service Comparison
8.2. Defining References To OSGi Services
8.2.1. Imported Service Availability
8.2.1.1. Mandatory Services and Application Startup
8.2.1.2. Relationship Between The Service Exporter And Service Importer
8.2.2. Referencing An Individual Service
8.2.2.1. Controlling The Set Of Advertised Interfaces For The Imported Service
8.2.2.2. The filter Attribute
8.2.2.3. The bean-name Attribute
8.2.2.4. The availability Attribute
8.2.2.5. The depends-on Attribute
8.2.2.6. The context-class-loader Attribute
8.2.2.7. The sticky Attribute
8.2.2.8. reference Element Attributes
8.2.2.9. reference And OSGi Service Dynamics
8.2.2.10. Getting A Hold Of The Managed Service Reference
8.2.3. Referencing A Collection Of Services
8.2.3.1. Greedy Proxying
8.2.3.2. Member Type
8.2.3.3. Collection (list And set) Element Attributes
8.2.3.4. list / set And OSGi Service Dynamics
8.2.3.5. Iterator Contract And Service Collections
8.2.4. Dealing With The Dynamics Of OSGi Imported Services
8.2.5. Blueprint reference Comparison
8.3. Listener And Service Proxies
8.4. Accessing The Caller BundleContext
8.5. Exporter/Importer Listener Best Practices
8.5.1. Listener And Cyclic Dependencies
8.6. Service Importer Global Defaults
9. Working With Bundles
10. Web Support
10.1. Supported Web Containers
10.2. Web Support Usage
10.3. WAR Classpath In OSGi
10.3.1. Static Resources
10.3.2. Servlets
10.3.3. Java Server Pages
10.3.3.1. Tag Libraries
10.4. Configuring The Web Extender
10.4.1. Changing The War Deployer
10.5. Customizing The Standard Deployers
10.6. OSGi-ready Libraries And Web Development
10.6.1. Deploying Web Containers As OSGi Bundles
10.6.1.1. Tomcat 5.5.x/6.0.x
10.6.1.2. Jetty 6.1.8+/6.2.0
10.6.2. Common Libraries
10.7. Spring-MVC Integration
11. Compendium Services
11.1. Configuration Admin
11.1.1. Exposing Configuration Admin Entries As Properties
11.1.2. Managed Properties
11.1.2.1. Configuration Admin Runtime Updates
11.1.3. Managed Service Factories
11.1.4. Direct Access To Configuration Data
12. Testing OSGi based Applications
12.1. OSGi Mocks
12.2. Integration Testing
12.2.1. Creating A Simple OSGi Integration Test
12.2.2. Installing Test Prerequisites
12.2.3. Advanced Testing Framework Topics
12.2.3.1. Customizing The Test Manifest
12.2.3.2. Customizing Test Bundle Content
12.2.3.3. Understanding The MANIFEST.MF Generation
12.2.4. Creating An OSGi Application Context
12.2.5. Specifying The OSGi Platform To Use
12.2.6. Waiting For The Test Dependencies
12.2.7. Testing Framework Performance
III. Other Resources
13. Useful Links
IV. Appendixes
A. Extensions
A.1. Annotation-Based Injection
A.1.1. Enabling/Disabling Annotation Processing
B. Security Integration
C. Eclipse Plug-in Development integration
D. Spring Dynamic Modules Maven Archetype
D.1. Generated Project Features At-A-Glance
E. Useful OSGi tips
E.1. OSGi Fragments
F. Roadmap
F.1. Start Level Integration
F.2. Web Library Integration
F.3. ORM/Persistence Support
G. Spring DM OSGi Repository
G.1. Spring DM Temporary OSGi Repository
G.1.1. Repository Conventions
G.1.2. Browsing The Repository Content
G.1.3. Using The Repository With Maven
G.1.4. Using The Repository With Ant/Ivy
H. Spring Dynamic Modules Schema
I. Acknowledgments