コンポーネント・タイプのリスト表示

ComponentInstanceManager.listComponentTypes()メソッドをコールして、Endeca IAS Serviceのすべてのコンポーネント・タイプをリスト表示します。このリリースでは、RecordStoreタイプのコンポーネントのみが存在します。

このメソッドの構文は、次のとおりです。
ComponentInstanceManager.listComponentTypes()

メソッドは、ComponentTypeDescriptorオブジェクトを返します。各ComponentTypeDescriptorオブジェクトは、TypeIdオブジェクトおよびInstallPathオブジェクトで構成されています。

TypeIdには、RecordStoreなどのコンポーネント・タイプがあります。各InstallPathは、コンポーネント自体を実装しているWARファイルの絶対パスを表す文字列です(例: C:\Oracle\Endeca\IAS\<バージョン>\components\RecordStore.war)。

コンポーネント・タイプをリスト表示するには:

  1. ServiceAddressオブジェクトを作成し、Component Instance Managerを実行しているサーバーのホストおよびポートを指定し、WebLogicにIASをインストールしている場合は、さらにcontextPathを指定します。JettyにIASをインストールしている場合は、contextPathを空の文字列に設定します。
  2. ComponentInstanceManagerLocatorcreate()メソッドをコールし、ServiceAddressオブジェクトに渡します。たとえば、次のようになります。
    ServiceAddress address = new ServiceAddress("localhost", 8401, contextPath); 
    ComponentInstanceManagerLocator locator = ComponentInstanceManagerLocator.create(address);
  3. ComponentInstanceManagerオブジェクトを作成し、getService()をコールして、サーバーおよびComponent Instance Managerサービスへの接続を確立します。たとえば、次のようになります。
    ComponentInstanceManager cim = locator.getService();
  4. listComponentTypes()をコールし、次にforループを作成して、システムのすべてのコンポーネント・タイプをループ処理します。ループ内で、TypeIdおよびInstallPathを取得して、それらをシステムの外部(またはその他の場所)に出力します。たとえば、次のようになります。
    for (ComponentTypeDescriptor desc : cim.listComponentTypes()) {
    	System.out.println(desc.getTypeId() + " installed at " + desc.getInstallPath());
    }