The code segment in Example — Setting a Property sets a hypothetical lockspeed value for all Solaris processors. This code segment uses the following methods:
enumInstances – to get the names of all instances of Solaris processor
setProperty – to set the value of the lockspeed for each instance
... { /* Create an object (CIMObjectPath) to store the name of the Solaris_Processor class. */ CIMObjectPath cop = new CIMObjectPath("Solaris_Processor"); /* The CIM Object Manager returns an enumeration containing the names of instances of the Solaris_Processor class and all its subclasses. */ Enumeration e = cc.enumerateInstanceNames(cop); /* Iterate through the enumeration of instance object paths. Use the setProperty method to set the lockspeed value to 500 for each Solaris processor. */ for (; e.hasMoreElements(); cc.setProperty(e.nextElement(), "lockspeed", new CIMValue(new Integer(500)))); ... }