別のバンドルの実行中にバンドルの開始を待つ必要がありますが、これは可能ですか?
3 に答える
つまり: バンドルの注文を開始します。
OSGi アプリケーションを開始するときと同様に、他のバンドルによって提供される下位レベルのサービスが上位レベルのサービス (/ 他のバンドル) で利用可能であることを確認するにはどうすればよいでしょうか。次に、Dynamic Services を読み込む必要があります。
この問題を解決するにはいくつかの方法があります (別のバージョンの OSGi では変更されているため)。OSGi とDynamic Serviceを初めて使用する場合、最も論理的な解決策はおそらくDeclarative Servicesですが、少なくともService Activator Toolkitについても読む必要があります。これには独自の長所と短所もあります。
この問題とそれを解決するための解決策を正確に説明しているオンラインのChapter 6, Dynamic Servicesがあります (少なくとも 3 つの解決策が説明されています)。
一般に、OSGi (Equinox) について学びたい/適用したい人には、OSGi and Equinoxという本をお勧めします。
You can do this in different ways. First, you might have a look at the start method of the Bundle interface class. With it, you can start a particular bundle. You also might have a look at Declarative Services or the Start Level Specification.
As a start you should read section 4.4.5 (Starting Bundles) of the OSGi core spec (available at www.osgi.org for free).
試しましたBundleContext.install()
か?(BundleContext
アクティベーターの start メソッドと stop メソッドで渡されます)