public class CacheFrameworkSample
{
public static void main(String[] args) throws Exception
{
ServiceInstance si = new ServiceInstance(new URL("http://10.20.143.205/sdk"), "root", "password", true);
Folder rootFolder = si.getRootFolder();
ManagedEntity[] vms = new InventoryNavigator(rootFolder).searchManagedEntities("VirtualMachine");
ManagedEntity[] hosts = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem");
CacheInstance vicf = new CacheInstance(si);
vicf.watch(vms, new String[] {"name", "runtime.powerState", "summary"});