Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Spring Dynamic Modules and OSGI


Let us look at how Spring Dynamic Modules work. Spring comes with its OSGI integration framework, which has a class called extender. This checks for all existing bundles and marks the bundles which are powered by Spring. The extender marks a bundle as Spring compatible only if it has Spring context manifest header or an XML file in META-INF/spring folder. All the preceding steps are triggered on start up and the extender package is available on org.springframeork.osgi.bundle.extender. Now, we have to know why Spring dynamic modules mark the Spring powered bundles. The bundles with Spring configuration files are further converted to an application-context object. The extender not only marks the Spring powered bundles to create an application-context object, but also checks if the bundle is importing any OSGI services. If any such bundle is found exporting an external service, then such beans are moved to the OSGI shared service registry. The extender registers...