UDDI 节点配置属性的管理

可以使用 UDDI 注册中心管理界面,通过设置配置属性来管理 UDDI 节点运行时行为。

UDDI 节点运行时行为受多个配置属性的设置影响。UddiNode MBean 提供以下操作来检查和更新配置属性:
  • getProperties
  • getProperty
  • updateProperty
  • updateProperties

WebSphere® Application Server 的样本中,UDDI 注册中心样本中的 ManagePropertiesSample 类演示这些操作。

getProperties
将所有配置属性的集合作为 ConfigurationProperty 对象返回。
  1. 调用 getProperties 操作:
    List properties = uddiNode.getProperties();
  2. 将每个集合成员强制转换为 ConfigurationProperty 对象:
     if (properties != null) {
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
           ConfigurationProperty property = (ConfigurationProperty) iter.next();
           System.out.println(property);
        }
     }
如果有 ConfigurationProperty 对象,那么可以检查诸如标识、值以及类型之类的属性。您可以确定属性是否为只读或是否为初始化所需,并获取名称和描述消息键。例如,如果调用 toString 方法,那么会返回类似以下示例的结果:
      ConfigurationProperty
      id: operatorNodeIDValue
      nameKey: property.name.operatorNodeIDValue
      descriptionKey: property.desc.operatorNodeIDValue
      type: java.lang.String
      value: uddi:capnscarlet:capnscarlet:server1:default
      unitsKey: 
      readOnly: true
      required: true
      usingMessageKeys: false
      validValues: none

使用样本软件包中的 messages.properties 资源时,可以使用 nameKey 和 descriptionKey 值来查找给定语言环境的已转换名称和描述。

getProperty
返回具有所指定标识的 ConfigurationProperty 对象。PropertyConstants 中指定了可用的属性标识以及相应属性的用途的描述。
  1. 调用 getProperty 操作:
    ConfigurationProperty property = 
    uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);
  2. 要检索属性值,可以使用返回对象的 getValue 方法,但在这种情况下,属性是整数类型,所以使用便捷方法 getIntegerValue 来获取值更容易:
    int maxResults = property.getIntegerValue();
updateProperty
更新具有指定标识的 ConfigurationProperty 对象的值。PropertyConstants 中指定了可用的属性标识以及相应属性的用途的描述。尽管您可以在 ConfigurationProperty 对象中调用 setter 方法,但在 UDDI 节点中只有该值可更新。要更新属性,通常使用以下步骤:
  1. 创建 ConfigurationProperty 对象并设置它的标识:
    ConfigurationProperty defaultLanguage = new ConfigurationProperty();
    defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);
  2. 设置值:
    defaultLanguage.setStringValue("ja");
  3. 调用 updateProperty 操作:
    uddiNode.updateProperty(defaultLanguage);
updateProperties
在单个请求中更新多个 ConfigurationProperty 对象。以适用于 updateProperty 操作的相同方式来设置 ConfigurationProperty 对象。
  1. 将已更新的属性添加到列表:
    List updatedProperties = new ArrayList();
                    
    updatedProperties.add(updatedProperty1);
    updatedProperties.add(updatedProperty2);
  2. 调用 updateProperties 操作:
    uddiNode.updateProperties(updatedProperties);

指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rwsu_ai_cp
文件名:rwsu_ai_cp.html