プロジェクトでApache Felix HTTP Service Jetty 2.2.0を使用 しています。ドキュメントに基づいて、デフォルトのサービス ポートを変更する次のコードを作成しました。
ConfigurationAdmin configAdmin = // get ConfigurationAdmin from OSGi service registry
Configuration config = configAdmin.getConfiguration("org.apache.felix.http" , null);
Dictionary<String, Object> props = config.getProperties();
if(props == null)
{
props = new Hashtable<String, Object>();
}
props.put("org.osgi.service.http.port", newport);
config.update(props);
ご覧のとおり、構成オブジェクトを取得し、プロパティを更新して update メソッドを呼び出します。これはすべて正常に機能しますがHttpService
、何らかの理由で新しい構成が取得されません。私は何を間違っていますか?その間に、システム プロパティ アプローチを使用してポートを変更できます。しかし、私ConfigurationAdmin
はそれを行うために使用できるようにしたい. Equinox 3.8
コンテナを実行しています