Client applications commonly use the getInstance method to retrieve CIM instances from the CIM Object Manager. When an instance of a class is created, it inherits the properties of the class it is derived from and all parent classes in its class hierarchy. The getInstance method takes the Boolean argument localOnly.
If localOnly is true, getInstance returns only the non-inherited properties in the specified instance. The non-inherited properties are those defined in the instance itself.
If localOnly is false, all properties in the class are returned; those defined in the instance, and all properties inherited from all parent classes in its class hierarchy.
Use the setInstance method to update an existing instance.
The following example gets instances of an object path in an enumeration, updates the property value of b to 10 in each instance, and passes the updated instances to the CIM Object Manager.
... { // Create an object path, an object that contains the CIM name for // "myclass" CIMObjectPath cop = new CIMObjectPath("myclass"); /* Get instances for each instance object path in an enumeration, update the property value of b to 10 in each instance, and pass the updated instance to the CIM Object Manager. */ while(e.hasMoreElements()) { CIMInstance ci = cc.getInstance((CIMObjectPath)(e.nextElement ()),true, true, true, null); ci.setProperty("b", new CIMValue(new Integer(10))); cc.setInstance(new CIMObjectPath(),ci); } } ...