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 ).