osgi - org.osgi.framework.storage.clean=onFirstInit 在 Apache Felix OSGi 实现的上下文中是什么意思?

标签 osgi apache-felix

我想弄清楚 org.osgi.framework.storage.clean=onFirstInit真正意味着在 Felix 框架的上下文中。

根据 OSGi 规范:

org.osgi.framework.storage: A valid file path in the file system to a directory... The framework is free to use this directory as it sees fit, for example, completely erase all files and directories in it...

org.osgi.framework.storage.clean: Specifies if and when the storage area for the framework should be cleaned. If no value is specified, the framework storage area will not be cleaned.



由于根据规范,框架可以自由使用它认为合适的目录,因此不清楚 OSGi 规范规定应清理存储区域的含义。对于每个 OSGi 实现来说,清理可能意味着不同的东西。

Apache Felix documentation状态:

onFirstInit flushes the bundle cache when the framework instance is first initialized.



特定于 Felix 文档:
  • “刷新捆绑缓存”是什么意思?刷新是否与删除存储目录然后从头开始重建它相同?所以它与 rm -rf felix-cache 相同当 Felix 容器关闭时,它会在启动时重建缓存,就好像这是第一次启动容器一样?
  • 当它说“第一次初始化框架实例时”是什么意思?这是否意味着仅在第一次启动容器时才首次初始化框架?还是说每次容器重启时框架第一次初始化?
  • 最佳答案

    What does it mean to "flush the bundle cache"?



    意思是删除org.osgi.framework.storage指定的目录

    Is flushing the same as deleting the storage directory and then rebuilding it from scratch?



    是的

    So it would be the same as rm -rf felix-cache while the Felix container is shut down so that when it starts up it rebuilds the cache as if this was the first time the container was started?



    是的

    What does it mean when it says "when the framework instance is first initialized"?



    捆绑包可以被初始化多次。此语句表示仅应在 JVM 启动后第一次删除该目录,而不应在系统捆绑包初始化后的后续时间删除该目录。

    Does this mean the first time the framework is initialized only on the first time the container is started? Or does it mean the first time the framework is initialized every time the container is restarted?



    表示每次容器重启时框架第一次初始化

    关于osgi - org.osgi.framework.storage.clean=onFirstInit 在 Apache Felix OSGi 实现的上下文中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26304588/

    相关文章:

    java - 从 OSGI bundle 调用 JDBC 和 UCP 连接

    java - Android:替换缺少的安全架构

    java - OSGI - 从另一个组件类中选择要激活的包

    css - 无法将 css 文件加载到 osgi 包中

    osgi - 什么时候应该使用 Import-Package,什么时候应该使用 Require-Bundle?

    maven - 在 Apache karaf 上的 bundle 中使用 Apache Camel

    java - 使用 Apache Felix iPOJO 事件管理处理程序

    java - Python 框架作为 "Java + OSGi"组合的替代品

    maven-2 - 使用 Maven 和 OSGi 快速周转

    osgi - 如何在 OSGi (Apache Felix) 中处理不同的日志记录解决方案