Java – how to define the OSGi bundle startup level?

How to define the OSGi package startup level?

I am using Apache Felix and want to maintain the starting level through framework execution I don't expect to change the bundle start level often in an entry in manifest MF seems to be the wisest I want org osgi. framework. Start level, but I don't see a practical example

I also use Maven and Maven bundle plugin. If there is an elegant way to integrate the start level in POM, it will be brilliant

Solution

The software package does not define its own start level during construction; The administrator or agent that installs the bundle into the framework defines it

The core framework defines the start level interface in Section 8 quote:

The last two are related to your inquiry Section 8.3 Section 4 – change the start level of the package – indicates that the framework will continue to store the assigned start level

If you use Apache Felix, you can install packages and assign their startup levels in a variety of ways, either explicitly or by allowing them to inherit the default startup level of installed packages:

>Felix file install (see felix.fileinstall.start.level attribute, although it is not every bundle) > Felix bundle auto deploy (see Felix. Auto. Install. < n > property) > gogo shell command (see the bundlevel command)

Also, see Felix startlevel. Bundle property, which controls bundling in the above way

As for setting manifest properties (for example, using Maven during construction), there was a way to do this in equinox - it has been deprecated - but there is no standard way to indicate a bundle to the framework what the correct start level should be

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>