Blueprint Environment Manager

Source: Internet
Author: User

The Blueprint Container specification also defines a number of special environment managers that set the ID and provide access to the environment components. They do not have XML definitions and cannot be overridden because their IDs are protected and cannot be used by other managers. The objects provided by the environment manager can only be injected into other managers that use references. The Blueprint Container specification defines 4 environment managers:


blueprintbundle
offer package   bundle (org.osgi.framework.Bundle)   object.
blueprintbundlecontext
offer package   bundlecontext (org.osgi.framework.BundleContext)   object.
blueprintcontainer
blueprintcontainer (Org.osgi.service.blueprint.container.BlueprintContainer)   Objects.
blueprintConverter
Provide the package with Converter(org.osgi.service.blueprint.container.Converter)Object that provides access to the Blueprint Container type conversion Tool

When used, it can be configured and used directly in the Blueprint.xml

Such as:

<bean id= "pbanklist" class= "com.lala.blueprint.client.BankListProcessor" ><property name= "bundle" ref= " Blueprintbundle "></property><property name=" Bundlecontext "ref=" Blueprintbundlecontext "></ Property><property name= "Blueprintcontainer" ref= "Blueprintcontainer" ></property><property name = "Converter" ref= "Blueprintconverter" ></property></bean>

Banklistprocessor, add variables to

Private Bundle bundle;private bundlecontext bundlecontext;private blueprintcontainer blueprintcontainer;private Converter Converter;


Finally, you need to add a dependency to the Pom.xml

<dependency><groupId>org.apache.aries.blueprint</groupId><artifactId> org.apache.aries.blueprint</artifactid><version>1.1.0</version><scope>provided</ Scope></dependency>


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Blueprint Environment Manager

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.