Permalink
Browse files

Trying to set context

  • Loading branch information...
1 parent bb80114 commit 610aca1ee63ac6574582becb556ab1ddc38f7584 @carlasouza carlasouza committed Jul 14, 2011
@@ -27,6 +27,7 @@
import org.globus.workspace.service.impls.async.RequestFactory;
import org.globus.workspace.service.impls.async.RequestFactoryImpl;
import org.globus.workspace.service.impls.async.WorkspaceRequest;
+import org.globus.workspace.service.impls.async.WorkspaceRequestContext;
import org.globus.workspace.xen.xenssh.Query;
import org.nimbustools.api.services.rm.ManageException;
@@ -116,17 +117,25 @@ protected void reaperVMM() throws ManageException {
for (ResourcepoolEntry r: vmms) {
String hostname = r.getHostname();
+// final WorkspaceRequestContext requestContext =
+// new WorkspaceRequestContext(id, resource.getName(),
+// this.locator, this.lager);
+
// These are the libvirt guest states
// 1 = running; 2 = idle; 3 = paused; 4 = shutdown; 5 = shut off; 6 = crashed; 7 = dying
WorkspaceRequest req = reqFactory.query();
+ //set context
String state = null;
try{
state = req.execute();
} catch (Exception e) {
//do something
}
- HashMap<String,Integer> result = gson.fromJson("query vmm", HashMap.class);//TODO get returned json
+ if (state != null) {
+ HashMap<String,Integer> result = gson.fromJson(state, HashMap.class);
+ }
+
}
InstanceResource[] ires = this.home.findAll();

0 comments on commit 610aca1

Please sign in to comment.