Spring Dynamic Modules Reference Guide

Authors

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

1.2.0-m2

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. What is new?
3.1. 1.1.x
3.1.1. Web Support
3.1.1.1. Spring-MVC Integration
3.1.2. Classpath Resource Abstraction
3.1.3. Pluggable Extender Configuration
3.1.4. Improved class loading
3.2. 1.2.x
3.2.1. Java 2 Security Integration
3.2.2. Compendium Services Support
3.2.3. Changed Spring DM symbolic names
II. Reference Documentation
4. Bundles and Application Contexts
4.1. The Spring Dynamic Modules Extender bundle
4.2. Application Context Creation
4.2.1. Mandatory Service Dependencies
4.2.2. Application Context Service Publication
4.3. Bundle Lifecycle
4.4. The Resource abstraction
4.5. Accessing the BundleContext
4.6. Application Context Destruction
4.7. Stopping the extender bundle
5. Packaging and Deploying Spring-based OSGi applications
5.1. Bundle format and Manifest headers
5.2. Extender configuration options
5.2.1. Listening to Extender events
5.3. Required Spring Framework and Spring Dynamic Modules Bundles
5.4. Spring XML authoring support
5.5. Importing and Exporting packages
5.6. Considerations when using external libraries
5.7. Diagnosing problems
6. The Service Registry
6.1. Exporting a Spring bean as an OSGi service
6.1.1. Controlling the set of advertised service interfaces for an exported service
6.1.1.1. Detecting the advertised interfaces at runtime
6.1.2. Controlling the set of advertised properties for an exported service
6.1.3. The depends-on attribute
6.1.4. The context-class-loader attribute
6.1.5. The ranking attribute
6.1.6. service element attribute
6.1.7. Service registration and unregistration lifecycle
6.1.7.1. Using OsgiServiceRegistrationListener interface
6.2. Defining references to OSGi services
6.2.1. Referencing an individual service
6.2.1.1. Controlling the set of advertised interfaces for the imported service
6.2.1.2. The filter attribute
6.2.1.3. The bean-name attribute
6.2.1.4. The cardinality attribute
6.2.1.5. The depends-on attribute
6.2.1.6. The context-class-loader attribute
6.2.1.7. reference element attributes
6.2.1.8. reference and OSGi Service Dynamics
6.2.1.9. Getting a hold of the managed service reference
6.2.2. Referencing a collection of services
6.2.2.1. Greedy Proxying
6.2.2.2. Collection (list and set) element attributes
6.2.2.3. list / set and OSGi Service Dynamics
6.2.2.4. Iterator contract and service collections
6.2.3. Dealing with the dynamics of OSGi imported services
6.2.4. Listener and service proxies
6.2.5. Accessing the caller BundleContext
6.3. Exporter/Importer listener best practices
6.3.1. Listener and cyclic dependencies
6.4. Service importer global defaults
6.5. Relationship between the service exporter and service importer
7. Working with Bundles
8. Web Support
8.1. Supported Web Containers
8.2. Web support usage
8.3. WAR classpath in OSGi
8.3.1. Static Resources
8.3.2. Servlets
8.3.3. Java Server Pages
8.3.3.1. Tag libraries
8.4. Configuring the web extender
8.4.1. Changing the war deployer
8.5. Customizing the standard deployers
8.6. OSGi-ready libraries and web development
8.6.1. Deploying web containers as OSGi bundles
8.6.1.1. Tomcat 5.5.x/6.0.x
8.6.1.2. Jetty 6.1.8+/6.2.0
8.6.2. Common libraries
8.7. Spring-MVC Integration
9. Compendium Services
9.1. Configuration Admin
9.1.1. Exposing Configuration Admin entries as Properties
9.1.2. Managed properties
9.1.2.1. Configuration Admin Runtime Updates
9.1.3. Managed service factories
9.1.4. Direct access to configuration data
10. Testing OSGi based Applications
10.1. OSGi Mocks
10.2. Integration Testing
10.2.1. Creating a simple OSGi integration test
10.2.2. Installing test prerequisites
10.2.3. Advanced testing framework topics
10.2.3.1. Customizing the test manifest
10.2.3.2. Customizing test bundle content
10.2.3.3. Understanding the MANIFEST.MF generation
10.2.4. Creating an OSGi application context
10.2.5. Specifying the OSGi platform to use
10.2.6. Waiting for the test dependencies
10.2.7. Testing framework performance
III. Other Resources
11. 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. Access to Service References for Collections
F.2. Start level integration
F.3. Web library integration
F.4. ORM/Persistence support
F.5. OSGi standards
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