What is bundle?

Source: Internet
Author: User

In osgi, all modules must be deployed in bundle mode. In osgi, bunlde is the smallest deployment unit, and osgi is a module in Java Modular programming.

So what is bundle?
Bundle is actually a jar file. The only difference between this jar file and a common JAR file is the content of manifest. MF file under the META-INF directory,
All information about a bundle is described in manifest. MF. It can be regarded as the metadata of a bundle.
Name, ID, description, developer, classpath, package to be imported, and output package.
Bundle is an independent concept. In the osgi framework, each bundle adopts an independent classloader mechanism, which means that the traditional
For example, if you reference other bundle projects to implement inter-bundle collaboration, how does one collaborate? In the osgi framework, each bundle can be defined.
The output package and the referenced package can share the classes in the package between bundle, although this can also achieve simple bundle collaboration,
However, in the osgi framework, we recommend that you use the service method. The concept of service-oriented (such as SOA) is widely used. The same is true for the osgi framework.
Bundlecontext can be used to register external services, and bundlecontext can be used to obtain services to be referenced,
The service-oriented method can make the external services more encapsulated, and the environment does not need to depend on the services provided by other bundle.
In addition, bundle can also use the required-Bundle Method to directly reference other bundle (equivalent to referencing other bundle projects or jar ).

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.