SPRING-OSGI 1.0 M3 Chinese Handbook

Source: Internet
Author: User
Tags definition header range split

For details about headers see section 3.2 of the OSGi specification. Some of the OSGi implementation frameworks may support some unusual jar packages, but the format of the jar packages about OSGi is unchanged.

The Spring Extender recognizes a bundle as "spring-powered" and'll create a associated application context when the bun Dle is started if one or both of the following conditions is true:

If the following two conditions are true, Spring extender through a bundle with "spring-powered" validation, which creates an associated application context for the bundle when it is started:

The bundle Classpath contains a folder meta-inf/spring with one or more files in so folder with a '. xml ' extension.

This bundle classpath contains a directory meta-inf/spring, which has one or more files with the name extension '. xml '.

Meta-inf/manifest. MF contains a manifest header spring-context.

The meta-inf/manifest in this bundle. The MF file contains a header named Spring-context.

In addition, if the optional Springextender-version header are declared in the bundle manifest, then Recognize bundles where the specified version constraints are satisfied by the version of the Extender bundle (bundle-ver Sion). The value of the Springextender-version header must follow the syntax for a Version range as specified to section 3.2.5 of The OSGi Service Platform Core specification.

In addition, if bundle's manifest declares an optional header-springextender-version, then Extender will only recognize The bundle (bundle bundle-version) that can be specified with the version constraint that matches it. The value of the springextender-version must follow the version range specified in the OSGi specification 3.2.5 section.

In the absence of the Spring-context header the Extender expects every ". xml" file in the Meta-inf/spring folder to be a V Alid Spring configuration file, and all directives (= below) take on their default values.

In the absence of Spring-context, Spring Extender still considers all files in the meta-inf/spring ". xml" to be Spring's configuration files, all headers are default values.

An application the constructed from this set of files. A suggested practice is to split the application context configuration in least two files, named by Convention module Name-context.xml and Modulename-osgi-context.xml. The Modulename-context.xml file contains regular beans definitions independent of any knowledge of OSGi. The Modulename-osgi-context.xml file contains the bean definitions for importing and exporting OSGi services. It may (but isn't required to) use the Spring Dynamic Modules OSGi schema as the top-level namespace instead of the Sprin G ' Beans ' namespace.

The application context is constructed from these files (". xml" files in meta-inf/spring). A recommended practice is to split the application context configuration file into at least 2 files, customarily named Module name-context.xml and module name-osgi-context.xml. The Modulename-context.xml file contains the definition of a bean that is not dependent on OSGi (which can be understood as a normal bean definition). The Modulename-osgi-context.xml file defines the beans that introduce or export the OSGi service. This may require using the OSGi schema of Spring Dynamic modules as the top-level namespace, replacing the spring's ' bean ' namespace, but this is not necessary.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.