Java 类com.vmware.vim25.HostRuntimeInfo 实例源码

项目:cloudstack    文件:ClusterMO.java   
@Override
public boolean isHyperHostConnected() throws Exception {
    ObjectContent[] ocs = getHostPropertiesOnCluster(new String[] {"runtime"});
    if (ocs != null && ocs.length > 0) {
        for (ObjectContent oc : ocs) {
            HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)oc.getPropSet().get(0).getVal();
            // as long as we have one host connected, we assume the cluster is up
            if (runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED)
                return true;
        }
    }
    return false;
}
项目:cloudstack    文件:HostMO.java   
@Override
public boolean isHyperHostConnected() throws Exception {
    HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)_context.getVimClient().getDynamicProperty(_mor, "runtime");
    return runtimeInfo != null && runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED;
}