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
3. What is new?
3.1. 1.1.x
3.1.1. Web Support Spring-MVC Integration
3.1.2. Classpath Resource Abstraction
3.1.3. Pluggable Extender Configuration
3.1.4. Improved class loading
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 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 Using OsgiServiceRegistrationListener interface
6.2. Defining references to OSGi services
6.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 reference
6.2.2. Referencing a collection of services Greedy Proxying Collection (list and set) element attributes list / set and OSGi Service Dynamics 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 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 Tomcat 5.5.x/6.0.x Jetty 6.1.8+/6.2.0
8.6.2. Common libraries
8.7. Spring-MVC Integration
9. Testing OSGi based Applications
9.1. OSGi Mocks
9.2. Integration Testing
9.2.1. Creating a simple OSGi integration test
9.2.2. Installing test prerequisites
9.2.3. Advanced testing framework topics Customizing the test manifest Customizing test bundle content Understanding the MANIFEST.MF generation
9.2.4. Creating an OSGi application context
9.2.5. Specifying the OSGi platform to use
9.2.6. Waiting for the test dependencies
9.2.7. Testing framework performance
III. Other Resources
10. Useful links
IV. 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. 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. Enhanced Configuration Admin Support
F.1.1. Managed Services
F.1.2. Managed Service Factories
F.1.3. Direct access to configuration data
F.1.4. Publishing configuration administration properties with exported services
F.2. Access to Service References for Collections
F.3. Start level integration
F.4. Web library integration
F.5. ORM/Persistence support
F.6. 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