// create a PropertyRequest requesting the specified // property names PropertyRequest wantedProps = new PropertyRequest(Resource.DISPLAY_NAME, Resource.COMMENT); // you must call doReadProperties to retrieve the properties // through the proxy my_resource = my_resource.doReadProperties(wantedProps); // work with the properties // for example, get and set values for these properties // ...
来自服务器的响应将通过 Rational® CM API 返回到客户机应用程序,该应用程序将成为包含请求的属性的新代理。由 doReadProperties 方法获取的属性值将存储在其返回的代理中。
当向代理填充属性后,可以使用 PropertyName 对象或属性代理类定义的访问方法从代理抽取这些属性的值。Rational CM API 为每个静态定义的属性提供了 getPropertyName 方法,以便从代理中获取属性值。请参阅 get 和 set 属性值方法的命名约定以获取更多信息。