![](/img/trans.png)
[英]Set a bundle start level programatically on embedded Apache Felix 5
[英]Change Bundle level in felix?
我知道如何為要部署的捆綁包設置初始捆綁包級別:
bundlelevel -i 5
但是,如何更改現有捆綁包的級別? Bundlelevel的幫助說:
bundlelevel - set bundle start level or initial bundle start level
scope: felix
flags:
-i, --setinitial set the initial bundle start level
-s, --setlevel set the bundle's start level
parameters:
int target level
Bundle[] target identifiers
bundlelevel - query bundle start level
scope: felix
parameters:
Bundle bundle to query
我不知道“ Bundle []”參數是什么。 我只嘗試了bundle_id和[bundle_id],甚至嘗試了包名。
讓我舉一個例子。 假設我想將5包(書架API)級別從1更改為2。
g! lb
START LEVEL 5
ID|State |Level|Name
0|Active | 0|System Bundle (3.0.7)
1|Active | 1|Apache Felix Bundle Repository (1.6.2)
2|Active | 1|Apache Felix Gogo Command (0.6.1)
3|Active | 1|Apache Felix Gogo Runtime (0.6.1)
4|Active | 1|Apache Felix Gogo Shell (0.6.1)
5|Active | 1|Bookshelf Inventory API (1.5.0)
我嘗試了以下方法:
g! bundlelevel -s 2 [5]
gogo: IllegalArgumentException: Cannot coerce
bundlelevel(String, String, ArrayList) to any of
[(boolean, boolean, int, Bundle[]), (Bundle)]
g! bundlelevel -s 2 5
Must specify target bundles.
任何幫助表示贊賞。
我猜不是最清晰的語法消息:) Bundle []指的是包ID。 lb,獲取所需捆綁的ID,然后運行
bundlelevel -s NEW_LEVEL BUNDLE_ID
例如:對於第4級和捆綁包10,請執行
捆綁級別-s 4 10
也許是因為錯過了-s而引起投訴?
在FUSE ESB上有一些經驗,但從未使用過felix。 剛剛下載了felix 3.0.8並嘗試:
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (3.0.8)
1|Active | 1|Apache Felix Bundle Repository (1.6.2)
2|Active | 1|Apache Felix Gogo Command (0.8.0)
3|Active | 1|Apache Felix Gogo Runtime (0.8.0)
4|Active | 1|Apache Felix Gogo Shell (0.8.0)
g! bundlelevel -s 10 4
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (3.0.8)
1|Active | 1|Apache Felix Bundle Repository (1.6.2)
2|Active | 1|Apache Felix Gogo Command (0.8.0)
3|Active | 1|Apache Felix Gogo Runtime (0.8.0)
4|Resolved | 10|Apache Felix Gogo Shell (0.8.0)
g!
我盡力重現您的問題,但沒有。 它按照指定的方式工作。 您是在全新安裝中還是在更新的felix版本中嘗試過(不知道您在使用什么)?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.