WBEMfor Solaris on Sun Developer's Guide

Example -- Enumerating Classes

A Java GUI application might use the code segment in Example 6-10 to display a list of classes and subclasses to a user. Once the user selects a particular class, the code enumerates the class.


Example 6-10 Enumerating Classes (enumClass)

/* Creates an object containing the path of a CIM object. */
CIMObjectPath (op = new(CIMObjectPath()); 
 
/* Specifies the object path name as A. */
cop.setName("A");	
 
/* Vector returns the object path of the object, classes, and 
all subclasses within those classes. The object path includes the 
namespace, class name, and keys (if the object is an instance). */
 
/* This vector contains the CIM Object Paths to the enumerated
classes. */
Vector v = cc.enumClass(cop, true);