Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1434)
@@ -7,25 +7,22 @@
 import java.util.Set;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.qcg.broker.schemas.resreqs.ParentType;
 import org.qcg.broker.schemas.resreqs.Workflow;
 import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
 
-import dcworms.schedframe.scheduling.ExecTask;
-
 import qcg.shared.constants.BrokerConstants;
 import schedframe.ExecutablesList;
+import schedframe.resources.computing.ComputingResource;
 import schedframe.scheduling.tasks.JobInterface;
 import schedframe.scheduling.tasks.Task;
+import dcworms.schedframe.scheduling.ExecTask;
 
 public class JobRegistryImpl extends AbstractJobRegistry {
 
-	private static Log log = LogFactory.getLog(JobRegistryImpl.class);
-
 	private String context;
-
+	private ComputingResource cr;
 	//TO DO - consider data structure
 	protected static final ExecutablesList executables = new ExecutablesList();
+
 	//protected static final List<ExecTask> executables = Collections.synchronizedList(new ArrayList<ExecTask>());;
 	//protected static final List<ExecTaskInterface> executables = new CopyOnWriteArrayList<ExecTaskInterface>();
@@ -34,8 +31,16 @@
 		this.context = context;
 	}
-
+	
+	public JobRegistryImpl(ComputingResource cr) {
+		this.cr = cr;
+	}
+
+	public JobRegistryImpl() {
+		this("");
+	}
+	
 	public boolean addExecTask(ExecTask newTask) {
 		if(getTask(newTask.getJobId(), newTask.getId()) == null) {
-			synchronized (executables)  {
+			synchronized (executables) {
 				executables.add(newTask);
 			}
@@ -53,17 +58,33 @@
 			for (ExecTask task: executables) {
 				if (task.getStatus() == status) {
-					Set<String> visitedResource = task.getAllocatedResources().getLast().getResourceNames();
-					for(String res: visitedResource){
-						if(res.equals(context) || res.substring(0, res.lastIndexOf("/")).contains(context)){
+					if(cr != null){
+						Set<ComputingResource> visitedResource = task.getAllocatedResources().getLast().getResources();
+						if(visitedResource.contains(cr)){
 							taskList.add(task);
-							break;
-						}
-					}
-					if(task.getSchedulerName().equals(context)) {
-						taskList.add(task);
-					}
-				}
-			}
-		}
+						} else {
+							for(ComputingResource res: visitedResource){
+								if(cr.contains(res)){
+									taskList.add(task);
+									break;
+								}
+							}
+						}
+					} else {
+						Set<String> visitedResource = task.getAllocatedResources().getLast().getResourceNames();
+						for(String res: visitedResource){
+							if(res.equals(context) || res.substring(0, res.lastIndexOf("/")).contains(context)){
+								taskList.add(task);
+								break;
+							}
+						}
+
+						if(task.getSchedulerName().equals(context)) {
+							taskList.add(task);
+						}
+					}
+				}
+			}
+		}
+
 		return taskList;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1423)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1434)
@@ -17,8 +17,10 @@
 	protected Map<ResourceUnitName, ResourceUnit> usedResources;
 	protected Set<String> resourceNames;
+	protected Set<ComputingResource> compResource;
 
 	public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){
 		this.usedResources = usedResources;
 		this.resourceNames = saveResourceNames();
+		this.compResource = saveResources();
 	}
 	
@@ -29,4 +31,8 @@
 	public Set<String> getResourceNames(){
 		return resourceNames;
+	}
+	
+	public Set<ComputingResource> getResources(){
+		return compResource;
 	}
 	
@@ -57,3 +63,30 @@
 		return resourceNames;
 	}
+	
+	private Set<ComputingResource> saveResources(){
+		Set<ComputingResource> compResources;
+		ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE);
+		compResources = new HashSet<ComputingResource>(pes.size(), 1);
+		for (ComputingResource resource: pes) {
+
+			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
+			toExamine.push(resource);
+
+			while (!toExamine.isEmpty()) {
+				ComputingResource compResource = toExamine.pop();
+				List<ComputingResource> resources = compResource.getChildren();
+				if(resources.isEmpty()){
+					if(!compResources.contains(compResource)){
+						compResources.add(compResource);
+					}
+				} else {
+					for (int i = 0; i < resources.size(); i++) {
+						ComputingResource resourceChild = resources.get(i);
+						toExamine.addLast(resourceChild);
+					}
+				}
+			}
+		}
+		return compResources;
+	}
 }
