gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 15:43:50 25 4
gpt4 key购买 nike

我想弄清楚 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/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com