The system bundle is a special bundle that represents the OSGi framework itself, from within that framework. It has the following roles:
- Exports packages from the JRE (excluding
java.*), for examplejavax.swing,org.w3c.cometc. - Exports the OSGi framework packages such as
org.osgi.framework. - Stopping the system bundle has the effect of shutting down the OSGi framework.
- Updating the system bundle has the effect of restarting the OSGi framework (requires support from the launcher).
The system bundle always has a bundle id of 0 (zero), so in code we can safely obtain a reference to it as follows:
Bundle systemBundle = context.getBundle(0);
本文详细介绍了OSGi框架中的系统bundle,它作为OSGi框架本身的特殊存在,扮演着核心角色。系统bundle不仅导出了JRE中的包(不包括java.*),还负责导出OSGi框架自身的包如org.osgi.framework等。停止或更新系统bundle将直接导致整个OSGi框架的关闭或重启。
304

被折叠的 条评论
为什么被折叠?



