简体   繁体   English

Apache felix:从嵌入了Felix的目录中加载捆绑文件

[英]Apache felix : Loading bundle files from dir with Felix embedded

I am using Apache Felix in embedded manner as explained in http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-launching-and-embedding.html 我正在以嵌入式方式使用Apache Felix,如http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-launching-and-embedding.html中所述

As per the discussion in Apache Felix File Install jar from deploy folder 根据Apache Felix从Deployment文件夹安装File jar中的讨论

1) Started felix 1)开始菲利克斯

2) Installed/started felix.fileinstall bundle on it 2)在其上安装/启动felix.fileinstall捆绑包

3) Set the System proper to hotdiploy dir ie 3)将系统设置为hotdiploy目录,即

System.setProperty("felix.fileinstall.dir", "file:C:/myrproject/hotdeploy"); System.setProperty(“ felix.fileinstall.dir”,“ file:C:/ myrproject / hotdeploy”);

I can see bundles in the dir are registered. 我可以看到目录中的包已注册。 But is there away that I can get notification when this dir change (adding or deleting new bundles)? 但是,在更改目录(添加或删除新捆绑包)时,是否可以得到通知? So in that case I can check for non started bundles and start them. 因此,在这种情况下,我可以检查未启动的捆绑包并启动它们。 That will help to work hot deployment feature realtime. 这将有助于实时运行热部署功能。

Thanks 谢谢

You can install org.apache.felix.eventadmin bundle, and then watch event topic org/osgi/framework/BundleEvent/STARTED . 您可以安装org.apache.felix.eventadmin捆绑包,然后观看事件主题org/osgi/framework/BundleEvent/STARTED Have a look at felix eventadmin . 看看felix eventadmin

Note that the felix web console is a good tool to watch events, at least for debugging purpose. 请注意,felix Web控制台是监视事件的好工具,至少用于调试目的。

鉴于您的问题包括“该目录更改时我可以得到通知的方式(添加或删除新捆绑包”),您可能正在寻找Apache Felix File Install捆绑包 ;另请参阅此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM