Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 2 of 7
In Spring DM, at the time of startup the org.springframeork.osgi.bundle.extender queries all of the existing bundles in the resolved state to learn if any of them is Spring powered. The extender bundle
considers a bundle to be Spring powered if it has the Spring-Context manifest header, or if it has XML files in its META-INF/spring folder.
Upon finding a Spring-powered bundle, the org.springframeork.osgi.bundle.extender loads the Spring configuration files in that bundle to create an application-context object for it. While creating the application-context
object, the extender also checks whether the bundle is exporting any OSGi services. If so, it exports that Spring bean to the OSGi shared-service
registry. If a bundle is importing an OSGI service, it finds the service and adds it as a normal Spring bean in the application
context for that bean. The extender also registers a listener for bundle events so that whenever any OSGi bundle goes into a resolved state it checks whether it is Spring powered and follows the same steps.
All of this will become more clear as you develop your first Spring DM application, starting with setting up the environment in the next section.
The Spring Dynamic Modules framework 1.0 supports the development of OSGi bundles compliant with OSGi Specification Release 4 and above and JDK 1.4 and above. Spring DM is also tested against the three open source OSGi container implementations: Equinox 3.2.2, Felix 1.0.1, and Knopflerfish 2.0.3, so you can execute your code in any of them.
In developing the examples for this article I have used Eclipse 3.3, which has the Equinox 3.3 OSGi container embedded. The Eclipse IDE provides excellent support for developing, executing, and debugging OSGi bundles. I tested the sample code for this article using JDK 1.5. Please follow these steps for setting up your development environment using the Eclipse IDE:
spring-osgi-1.0.2-with-dependencies.zip or most current equivalent.
spring-osgi-1.0.2-with-dependencies.zip onto your machine, say in your c:\software folder.
c:\sample\springdm.
C:\software\spring-osgi-1.0.2\dist, as shown in Figure 1.org.springframeork.osgi.bundle.coreorg.springframeork.osgi.bundle.extenderorg.springframeork.osgi.bundle.ioC:\software\spring-osgi-1.0.2\lib, so go back and repeat Steps 4 and 5. In Step 6, choose a plug-in location equal to C:\software\spring-osgi-1.0.2\lib and click Next.
org.springframeork.bundle.spring.aoporg.springframeork.bundle.spring.beansorg.springframeork.bundle.spring.contextorg.springframeork.bundle.spring.coreorg.springframeork.bundle.spring.jdbcorg.springframeork.bundle.spring.txorg.springframeork.osgi.aopalliance.osgibackport-util-concurrent.osgi-3.0-SNAPSHOT.jar (if you're using JDK 1.4)Apache Commons Logging is the logging framework for Spring DM. Spring DM provides Apache Commons Logging, as well as Apache Log4j JARs, in the OSGi bundle format. It seems there is some issue with these bundles, however, for I was not able to import them using Eclipse. If you encounter the same problem, take the following steps to create your own OSGi bundle containing these two JARs:
commons-logging.jar and log4j-1.2.14.jar. Your JAR Selection dialog should look like the screenshot in Figure 2.org.apache.commons.logging. In the Target Platform section select OSGi Framework --> Standard and click Finish.With this you have set up your Eclipse environment for developing Spring Dynamic Modules plugins. Are you ready to try developing a Hello World application using Spring DM?
Technology downloads
More
Archived Discussions (Read only)