Spring Dynamic Modules Reference Guide


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


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.

I. Introduction
1. Why Spring Dynamic Modules?
2. Requirements
II. Reference Documentation
3. Bundles and Application Contexts
3.1. The Spring Dynamic Modules Extender bundle
3.2. Application Context Creation
3.2.1. Mandatory Service Dependencies
3.2.2. Application Context Service Publication
3.3. Bundle Lifecycle
3.4. The Resource abstraction
3.5. Accessing the BundleContext
3.6. Application Context Destruction
3.7. Stopping the extender bundle
4. Packaging and Deploying Spring-based OSGi applications
4.1. Bundle format and Manifest headers
4.2. Required Spring Framework and Spring Dynamic Modules Bundles
4.3. Importing and Exporting packages
4.4. Considerations when using external libraries
4.5. Diagnosing problems
5. The Service Registry
5.1. Exporting a Spring bean as an OSGi service
5.1.1. Controlling the set of advertised service interfaces for an exported service Detecting the advertised interfaces at runtime
5.1.2. Controlling the set of advertised properties for an exported service
5.1.3. The depends-on attribute
5.1.4. The context-class-loader attribute
5.1.5. The ranking attribute
5.1.6. service element attribute
5.1.7. Service registration and unregistration lifecycle Using OsgiServiceRegistrationListener interface
5.2. Defining references to OSGi services
5.2.1. Referencing an individual service Controlling the set of advertised interfaces for the imported service The filter attribute The bean-name attribute The cardinality attribute The depends-on attribute The context-class-loader attribute reference element attributes reference and OSGi Service Dynamics Getting a hold of the managed service service reference
5.2.2. Referencing a collection of services Collection (list and set) element attributes list / set and OSGi Service Dynamics Iterator contract and service collections
5.2.3. Dealing with the dynamics of OSGi imported services
5.2.4. Listener and service proxies
5.2.5. Accessing the caller BundleContext
5.3. Exporter/Importer listener best practices
5.3.1. Listener and cyclic dependencies
5.4. Service importer global defaults
5.5. Relationship between the service exporter and service importer
6. Working with Bundles
7. Testing OSGi based Applications
7.1. OSGi Mocks
7.2. Integration Testing
7.2.1. Creating a simple OSGi integration test
7.2.2. Installing test prerequisites
7.2.3. Advanced testing framework topics Customizing test manifest Customizing test bundle content
7.2.4. Creating an OSGi application context
7.2.5. Specifying the OSGi platform to use
7.2.6. Waiting for the test dependencies
7.2.7. Testing framework performance
III. Appendixes
A. Compendium Services
A.1. Configuration Admin
A.1.1. Property placeholder support
A.1.2. Configuration Dictionaries
B. Extensions
B.1. Annotation-based injection
C. Eclipse Plug-in Development integration
D. Roadmap
D.1. Enhanced Configuration Admin Support
D.1.1. Managed Services
D.1.2. Managed Service Factories
D.1.3. Direct access to configuration data
D.1.4. Publishing configuration administration properties with exported services
D.2. Access to Service References for Collections
D.3. Start level integration
D.4. Web application support
D.5. ORM/Persistence support
D.6. OSGi standards
E. Spring Dynamic Modules Schema
F. Acknowledgments
IV. Other Resources
8. Useful links