Index: DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 478)
+++ DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 481)
@@ -8,5 +8,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -28,6 +28,6 @@
 import schedframe.scheduling.manager.resources.ManagedResources;
 import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.tasks.WorkloadUnit;
 
@@ -117,5 +117,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					send(this.get_id(), delay, WormsTags.TIMER);
+					send(this.get_id(), delay, DCWormsTags.TIMER);
 				}
 			}
@@ -174,5 +174,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -181,5 +181,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
@@ -271,5 +271,5 @@
 	public List<QueueDescription> getQueuesDescription(){
 		List<QueueDescription> queues = new ArrayList<QueueDescription>();
-		for(TaskQueue queue: managementSystem.getAccessQueues()){
+		for(TaskQueue queue: managementSystem.getQueues()){
 			QueueDescription qd;
 			try {
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 481)
@@ -3,5 +3,5 @@
 import schedframe.Plugin;
 import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistry;
@@ -12,5 +12,5 @@
 public interface SchedulingPlugin extends Plugin{
 
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+	public int placeTasksInQueues(TaskListImpl newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList modules);
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 481)
@@ -4,9 +4,7 @@
 import eduni.simjava.Sim_system;
 import gridsim.Accumulator;
-import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.ResourceCalendar;
-import gridsim.gssim.WormsTags;
-import gridsim.gssim.filter.SubTaskFilter;
+import gridsim.gssim.DCWormsTags;
+import gridsim.gssim.filter.ExecTaskFilter;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -27,9 +25,7 @@
 import qcg.shared.constants.BrokerConstants;
 import schedframe.ResourceController;
-import schedframe.events.scheduling.EventReason;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.events.scheduling.SchedulingEventType;
 import schedframe.events.scheduling.StartTaskExecutionEvent;
-import schedframe.events.scheduling.TaskCanceledEvent;
 import schedframe.events.scheduling.TaskFinishedEvent;
 import schedframe.events.scheduling.TaskRequestedTimeExpiredEvent;
@@ -45,7 +41,7 @@
 import schedframe.scheduling.ResourceHistoryItem;
 import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.UsedResourceList;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.WorkloadUnitListImpl;
 import schedframe.scheduling.manager.resources.LocalResourceManager;
 import schedframe.scheduling.manager.resources.ManagedResources;
@@ -63,9 +59,8 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import simulator.utils.DoubleMath;
 
@@ -112,8 +107,8 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
+		case DCWormsTags.TIMER:
 			if (pluginSupportsEvent(tag)) {
 				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TIMER);
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -123,12 +118,12 @@
 			break;
 
-		case WormsTags.TASK_READY_FOR_EXECUTION:
+		case DCWormsTags.TASK_READY_FOR_EXECUTION:
 			
 			ExecTask data = (ExecTask) ev.get_data();
 			try {
-				data.setStatus(Gridlet.READY);
+				data.setStatus(DCWormsTags.READY);
 				if (pluginSupportsEvent(tag)) {
 					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
-					SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+					SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 							queues,  getJobRegistry(), getResourceManager(), moduleList);
 					executeSchedulingPlan(decision);
@@ -139,15 +134,15 @@
 			break;
 
-		case WormsTags.TASK_EXECUTION_FINISHED:
+		case DCWormsTags.TASK_EXECUTION_FINISHED:
 			obj = ev.get_data();
-			ExecTask task = (ExecTask) obj;
-			if (task.getStatus() == Gridlet.INEXEC) {
-				finalizeExecutable(task);
-				SubmittedTask subTask = (SubmittedTask)task;
-				sendFinishedWorkloadUnit((ExecTask)subTask.getGridlet());
+			ExecTask exec = (ExecTask) obj;
+			if (exec.getStatus() == DCWormsTags.INEXEC) {
+				finalizeExecutable(exec);
+
+				sendFinishedWorkloadUnit(exec);
 				//task.setGridletStatus(Gridlet.SUCCESS);
 				//task.finalizeGridlet();
-				log.debug(task.getJobId() + "_" + task.getId() + " finished execution on " + new DateTime());
-				log.info(WormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
+				log.debug(exec.getJobId() + "_" + exec.getId() + " finished execution on " + new DateTime());
+				log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
 				/*UsedResourceList<ResourceHistoryItem> lastUsedList = task.getUsedResources();
 				Map<ResourceUnitName, AbstractResourceUnit> lastUsed = lastUsedList.getLast()
@@ -163,10 +158,10 @@
 			}
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskFinishedEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
+				SchedulingEvent event = new TaskFinishedEvent(exec.getJobId(), exec.getId());
+				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
 			}
-			Job job = jobRegistry.getJob(task.getJobId());
+			Job job = jobRegistry.getJob(exec.getJobId());
 			if(!job.isFinished()){
 				getWorkloadUnitHandler().handleJob(job);
@@ -174,10 +169,10 @@
 
 			break;
-		case WormsTags.TASK_REQUESTED_TIME_EXPIRED:
+		case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED:
 			obj = ev.get_data();
-			task = (SubmittedTask) obj;
+			exec = (Executable) obj;
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
+				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(exec.getJobId(), exec.getId());
+				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -185,5 +180,5 @@
 
 			break;
-		case WormsTags.UPDATE:
+		case DCWormsTags.UPDATE:
 			updateProcessingTimes(ev);
 			break;
@@ -193,7 +188,7 @@
 
 	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
-		if (pluginSupportsEvent(WormsTags.TASK_EXECUTION_FINISHED)) {
+		if (pluginSupportsEvent(DCWormsTags.TASK_EXECUTION_FINISHED)) {
 			SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_FINISHED);
-			SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+			SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 					queues, getJobRegistry(), getResourceManager(), moduleList);
 			executeSchedulingPlan(decision);
@@ -203,117 +198,47 @@
 		//}
 	}
-
-	public void notifyCanceledWorkloadUnit(WorkloadUnit job) {
-
-		if (!pluginSupportsEvent(GridSimTags.GRIDLET_CANCEL))
-			return;
-
-		Executable executable = (Executable) job;
-		String jobID = executable.getJobId();
-
-		SchedulingPlanInterface decision = null;
-
-		try {
-			executable.setStatus((int) BrokerConstants.JOB_STATUS_CANCELED);
-
-			TaskCanceledEvent event = new TaskCanceledEvent(executable.getJobId(), executable.getTaskId());
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			decision = schedulingPlugin
-					.schedule(event, queues, getJobRegistry(), getResourceManager(), moduleList);
-
-			if (decision == null)
-				return;
-
-			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-
-				// not scheduled again are returned to the user.
-				if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
-					continue;
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
+				continue;
+			}
+
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+
+			TaskInterface<?> task = taskDecision.getTask();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				if (allocation.isProcessing()) {
+					ExecTask exec = (ExecTask) task;					
+					executeTask(exec, allocation.getRequestedResources());
+				} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
+					allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
+					submitTask(task, allocation);
+				} else {
+					ExecTask exec = (ExecTask) task;
+					executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
 				}
-
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				WorkloadUnit task = taskDecision.getTask();
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					if (allocation.isProcessing()) {
-						
-						ExecTask exec = (ExecTask) task;
-						
-
-						//Executable e = (Executable)task;
-						/*SubmittedTask submittedTask = jobRegistry.getSubmittedTask(e.getJobId(), e.getId());
-						if(submittedTask == null)
-						{	submittedTask = new SubmittedTask(e);
-							jobRegistry.addTask(submittedTask);
-						}*/
-
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						
-												
-						executeTask(exec, allocation.getRequestedResources());
-					//} else if(GridSim.getEntityId(allocation.getProviderName()) != -1 || scheduler.getScheduler(allocation.getProviderName())!=null){
-					} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
-						allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
-						submitWorkloadUnit(task, allocation);
-					} else {
-
-						ExecTask exec = (ExecTask) task;
-						
-							//Executable exec = jobRegistry.createExecutable(t, allocation);
-							//exec.setResourceParameter(scheduler.get_id(), 1);
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
-					}
-				}
-
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
+			}
+
 		}
 	}
 
 	protected void executeTask(ExecTask task, Map<ResourceUnitName, ResourceUnit> choosenResources) {
-	//	Executable exec = (Executable) task;
-	
-		SubmittedTask submittedTask = (SubmittedTask)task;
+
+		Executable exec = (Executable)task;
 		boolean allocationStatus = getAllocationManager().allocateResources(choosenResources);
 		if(allocationStatus == false)
 			return;
 		removeFromQueue(task);
-		//SubmittedTask submittedTask = (SubmittedTask)task;
-		/* submittedTask = jobRegistry.getSubmittedTask(exec.getJobId(), exec.getId());
-		if(submittedTask == null)
-		{	submittedTask = new SubmittedTask(exec);
-			jobRegistry.addTask(submittedTask);
-		}*/
-		double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength();
+		//double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength();
 		SchedulingEvent event = new SchedulingEvent(SchedulingEventType.START_TASK_EXECUTION);
 		int time = Double.valueOf(
-				execTimeEstimationPlugin.execTimeEstimation(event, task, choosenResources, completionPercentage)).intValue();
+				execTimeEstimationPlugin.execTimeEstimation(event, task, choosenResources, exec.getCompletionPercentage())).intValue();
 		log.debug(task.getJobId() + "_" + task.getId() + " starts executing on " + new DateTime()
 				+ " will finish after " + time);
@@ -322,25 +247,27 @@
 			return;
 
-		submittedTask.setEstimatedDuration(time);
+		exec.setEstimatedDuration(time);
 		DateTime currentTime = new DateTime();
 		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);
-		submittedTask.setFinishTime(currentTime.getMillis() / 1000);
-		
-		jobRegistry.saveHistory(submittedTask, time, choosenResources);
-		
-		scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED,
-				submittedTask);
+		exec.addUsedResources(resHistItem);
+
+		scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED,
+				exec);
 
 		try {
-			long expectedDuration = submittedTask.getExpectedDuration().getMillis() / 1000;
-			scheduler.sendInternal(expectedDuration, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
+			long expectedDuration = exec.getExpectedDuration().getMillis() / 1000;
+			scheduler.sendInternal(expectedDuration, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
 		} catch (NoSuchFieldException e) {
-			double t = submittedTask.getEstimatedDuration();
-			scheduler.sendInternal(t, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
-		}
-		
-		submittedTask.setGridletStatus(Gridlet.INEXEC);
-		log.info(WormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
+			double t = exec.getEstimatedDuration();
+			scheduler.sendInternal(t, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
+		}
+		
+		try {
+			exec.setStatus(DCWormsTags.INEXEC);
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
 		
 		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
@@ -348,5 +275,5 @@
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 			}
 		} else {
@@ -357,5 +284,5 @@
 				
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 		}
 		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(StandardResourceUnitName.PE);
@@ -371,10 +298,15 @@
 	}
 	
-	public void finalizeExecutable(ExecTask exec){
-		
-		SubmittedTask subTask = (SubmittedTask)exec;
-		subTask.setGridletStatus(Gridlet.SUCCESS);
-		subTask.finalizeGridlet();
-		UsedResourceList<ResourceHistoryItem> lastUsedList = subTask.getUsedResources();
+	public void finalizeExecutable(ExecTask execTask){
+		
+		Executable exec = (Executable)execTask;
+		try {
+			exec.setStatus(DCWormsTags.SUCCESS);
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		exec.finalizeExecutable();
+		UsedResourceList<ResourceHistoryItem> lastUsedList = exec.getUsedResources();
 		Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast()
 				.getResourceUnits();
@@ -385,5 +317,5 @@
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 			}
 		} else {
@@ -394,5 +326,5 @@
 				
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 		}
 		/*ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PE);
@@ -400,19 +332,19 @@
 			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
 		}*/
-		SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_REQUESTED_TIME_EXPIRED);
+		ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_REQUESTED_TIME_EXPIRED);
 		scheduler.sim_cancel(filter, null);
 		
-		Executable executable = (Executable) subTask.getGridlet();
-		Job job = jobRegistry.getJob(executable.getJobId());
+
+		Job job = jobRegistry.getJob(exec.getJobId());
 
 		Task task = null;
 		try {
-			task = job.getTask(executable.getTaskId());
+			task = job.getTask(exec.getTaskId());
 		} catch (NoSuchFieldException e) {
 			e.printStackTrace();
 		}
-		if(executable.getProcessesId() == null){
+		if(exec.getProcessesId() == null){
 			try {
-				task.setStatus(executable.getStatus());
+				task.setStatus(exec.getStatus());
 			} catch (Exception e) {
 				e.printStackTrace();
@@ -422,6 +354,6 @@
 			for(int i = 0; i < processesList.size(); i++){
 				AbstractProcesses processes = processesList.get(i);
-				if(processes.getId().equals(executable.getProcessesId())){
-					processes.setStatus(executable.getStatus());
+				if(processes.getId().equals(exec.getProcessesId())){
+					processes.setStatus(exec.getStatus());
 					break;
 				}
@@ -441,11 +373,11 @@
 		while (iter.hasNext()) {
 			ExecTask task = iter.next();
-			SubmittedTask subTask = (SubmittedTask)task;
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			Executable exec = (Executable)task;
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources();
 			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
 					.get(StandardResourceUnitName.PE);
 
 			double load = getMIShare(timeSpan, (PEUnit) unit);
-			subTask.updateGridletFinishedSoFar(load);
+			exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration());
 			addTotalLoad(load);
 		}
@@ -471,6 +403,6 @@
 		updateProcessingProgress();
 		for (ExecTask task : jobRegistry.getRunningTasks()) {
-			SubmittedTask subTask = (SubmittedTask)task;
-			List<String> visitedResource = subTask.getVisitedResources();
+			Executable exec = (Executable)task;
+			List<String> visitedResource = exec.getVisitedResources();
 			String originResource = ev.get_data().toString();
 			if(!ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), originResource)){
@@ -478,8 +410,8 @@
 			}
 			
-			Map<ResourceUnitName, ResourceUnit> choosenResources = subTask.getUsedResources().getLast().getResourceUnits();
-			double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
+			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits();
+			//double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
 			double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					task, choosenResources, completionPercentage);
+					task, choosenResources, exec.getCompletionPercentage());
 
 			/*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) {
@@ -487,10 +419,10 @@
 			}*/
 			//check if the new estimated end time is equal to the previous one; if yes the continue without update
-			if( DoubleMath.subtract((subTask.getExecStartTime() + subTask.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){
+			if( DoubleMath.subtract((exec.getExecStartTime() + exec.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){
 				continue;
 			}
-			SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_EXECUTION_FINISHED);
+			ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 			scheduler.sim_cancel(filter, null);
-			scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED, task);
+			scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, task);
 
 		}
@@ -577,63 +509,13 @@
 			}
 
-			/*try {
-				List<? extends ComputingResource> processingElements = resourceManager.getResourcesOfType(StandardResourceType.Processor);
-				List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();
-				int peSize = processingElements.size();
-				for (int i = 0; i < peSize && cpuRequest > 0; i++) {
-					if (processingElements.get(i).getStatus() == ResourceStatus.FREE) {
-						choosenResources.add(processingElements.get(i));
-						cpuRequest--;
-					}
-				}
-				if (cpuRequest > 0)
-				{	
-					return null;
-				}
-				processingUnits = new ProcessingElements(choosenResources);
-			} catch (Exception e) {
-	
-				List<ResourceUnit> procResUnit = resourceManager.getDistributedResourceUnits(StandardResourceUnitName.PE);
-
-				for(ResourceUnit resUnit: procResUnit){
-					if (resUnit.getFreeAmount() >= cpuRequest)
-					{	
-						processingUnits = new PEUnit(resUnit.getResourceId(), cpuRequest, cpuRequest);
-						break;
-					} 
-				}
-			}*/
 			map.put(StandardResourceUnitName.PE, choosenPEUnits.get(0));
 		}
-		/*int memoryRequest;
-		try {
-			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			memoryRequest = 0;
-		}
-		if (memoryRequest != 0) {
-			List<ResourceUnit> resUnit = resourceManager.getSharedResourceUnits().get(StandardResourceUnitName.MEMORY);
-
-			Memory memory = null;
-			for (ResourceUnit memUnit : resUnit) {
-				Memory m = (Memory) memUnit;
-
-				if (m.getFreeAmount() >= memoryRequest) {	
-					System.out.println(m.getResourceId()+ ";"+m.getAmount()+";"+m.getFreeAmount());
-					memory = new Memory(m, memoryRequest, memoryRequest);
-				}
-			}
-			if(memory == null)
-				return null;
-			map.put(StandardResourceUnitName.MEMORY, memory);
-		}*/
+
 		return  map;
 	}
-
-
-	
-	public void notifySubmittedWorkloadUnit(WorkloadUnit job, boolean ack) {
+	
+	public void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack) {
 		updateProcessingProgress();
-		registerWorkloadUnit(job);
+		registerWorkloadUnit(wu);
 	}
 
@@ -654,6 +536,6 @@
 			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 			jobsList.add(job);
-			WorkloadUnitListImpl readyTasks = new WorkloadUnitListImpl();
-			for(Task task: jobRegistry.getReadyTasks(jobsList)){
+			TaskListImpl readyTasks = new TaskListImpl();
+			for(Task task: jobRegistry.getAvailableTasks(jobsList)){
 				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
 				readyTasks.add(task);
@@ -667,17 +549,13 @@
 		public void handleTask(TaskInterface<?> ti){
 			Task task = (Task)ti;
-			
-			if(task.getProcesses() == null){
+			List<AbstractProcesses> processes = task.getProcesses();
+
+			if(processes == null || processes.size() == 0){
 				Executable exec = new Executable(task);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
 				registerWorkloadUnit(exec);
 			} else {
-				List<AbstractProcesses> processesList = task.getProcesses();
-				for(int i = 0; i < processesList.size(); i++){	
-					AbstractProcesses processes = processesList.get(i);
-					Executable exec = new Executable(task, processes);
-					exec.setUserID(task.getSenderId());
-					exec.setLength(task.getLength());
+				for(int j = 0; j < processes.size(); j++){
+					AbstractProcesses procesesSet = processes.get(j);
+					Executable exec = new Executable(task, procesesSet);
 					registerWorkloadUnit(exec);
 				}
@@ -701,34 +579,13 @@
 			}
 			
-			exec.setResourceParameter(scheduler.get_id(), 1);
-			SubmittedTask subTask = new SubmittedTask(exec);
-			jobRegistry.addTask(subTask);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(subTask);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (subTask.getStatus() == Gridlet.QUEUED) {
+			exec.setSchedulerName(scheduler.get_id());
+			jobRegistry.addExecTask(exec);
+			TaskListImpl newTasks = new TaskListImpl();
+			newTasks.add(exec);
+		
+			schedulingPlugin.placeTasksInQueues(newTasks, queues, getResourceManager(), moduleList);
+
+			if (exec.getStatus() == DCWormsTags.QUEUED) {
 				sendExecutableReadyEvent(exec);
-			}
-		}
-		
-		public void handleSubmittedTask(SubmittedTask task){
-
-			task.visitResource(scheduler.get_name());
-			Scheduler parentScheduler = scheduler.getParent();
-			while (parentScheduler != null && !task.getVisitedResources().contains(parentScheduler.get_name())) {
-				task.visitResource(parentScheduler.get_name());
-				parentScheduler = parentScheduler.getParent();
-			}
-
-			jobRegistry.addTask(task);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(task);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (task.getStatus() == Gridlet.QUEUED) {
-				sendExecutableReadyEvent(task);
 			}
 		}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 481)
@@ -19,5 +19,4 @@
 public class GridBroker extends GlobalManagementSystem { 
 
-	
 	private static Log log = LogFactory.getLog(GridBroker.class);
 
@@ -27,25 +26,11 @@
 	public GridBroker(String name, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues) throws Exception {
 		super(name, "BROKER",  schedulingPlugin, execTimeEstimationPlugin, queues);
-		
-		//make use of plug-in interface
-		
-		//Properties prop = new Properties();
-		//prop.put("plugin.name", name);
-		//prop.put("plugin.utils.timeoperations", "gssim.scheduling.plugin.local.GssimTimeOperations");
-		//schedulingPlugin.init(prop);
+
 		otherGridSchedulersIds = new HashSet<Integer>();
-		
 		moduleList = new ModuleListImpl(2);
-		//this.moduleList.add(new GridResourceDiscovery(this.getScheduler()));
-		//moduleList.add(new GridReservationManagerNew(this));
-		
-		if(log.isDebugEnabled())
-			log.debug(name + ": Creating a broker interface object");
 	}
 
 	public void init(Scheduler scheduler, ManagedResources managedResources) {
 		super.init(scheduler, managedResources);
-		//this.scheduler = scheduler;
-		//this.resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
 		this.moduleList.add((GridResourceDiscovery)resourceManager);
 	}
@@ -57,5 +42,4 @@
 		}
 		return providerIds;
-		//return GridSim.getGridResourceList();
 	}
 
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 481)
@@ -12,13 +12,9 @@
 
 import qcg.shared.constants.BrokerConstants;
-
-import schedframe.events.scheduling.EventReason;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.events.scheduling.TaskArrivedEvent;
-import schedframe.events.scheduling.TaskCanceledEvent;
 import schedframe.events.scheduling.TimerEvent;
-import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
@@ -31,15 +27,12 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -54,7 +47,4 @@
 		super(providerId, entityName,  execTimeEstimationPlugin, queues);
 
-		/*schedulingPlugin = (GlobalSchedulingPlugin) InstanceFactory.createInstance(
-				schedulingPluginClassName,
-				GlobalSchedulingPlugin.class);*/
 		if(schedPlugin == null){
 			throw new Exception("Can not create global scheduling plugin instance");
@@ -69,8 +59,8 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
-			if (pluginSupportsEvent(WormsTags.TIMER)) {
+		case DCWormsTags.TIMER:
+			if (pluginSupportsEvent(DCWormsTags.TIMER)) {
 				TimerEvent event = new  TimerEvent();
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -114,11 +104,11 @@
 	
 
-	protected void scheduleReadyTasks(Job job){
+	protected void scheduleAvaialbleTasks(Job job){
 		List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 		jobsList.add(job);
-		WorkloadUnitListImpl readyWorkloadUnits = new WorkloadUnitListImpl();
-		readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobsList));
-		schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues, getResourceManager(), moduleList);
-
+		TaskListImpl readyTasks = new TaskListImpl();
+		readyTasks.addAll(jobRegistry.getAvailableTasks(jobsList));
+		
+		schedulingPlugin.placeTasksInQueues(readyTasks, queues, getResourceManager(), moduleList);
 		schedule(new TaskArrivedEvent());
 	}
@@ -126,15 +116,8 @@
 	protected void schedule(SchedulingEvent schedulingEvent) {
 
-		try {
-			SchedulingPlanInterface decision = schedulingPlugin.schedule(
-					schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
-			if (decision == null)
-				return;
-
+		SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(
+				schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
+		if (decision != null)
 			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
 	}
 	
@@ -173,5 +156,5 @@
 			}
 			else {
-				scheduleReadyTasks(job);
+				scheduleAvaialbleTasks(job);
 				/*List<JobInterface<?>> jobs = new ArrayList<JobInterface<?>>();
 				jobs.add(jobRegistry.getJobInfo(job.getId()));
@@ -189,67 +172,91 @@
 	}
 
-	public void notifyCanceledWorkloadUnit(WorkloadUnit wu){;
-
-		Executable task = (Executable) wu;
-		String jobID = task.getJobId();
-		String taskID = task.getId();
-		
-		if(log.isDebugEnabled())
-			log.debug("Received canceled job" + jobID + "_" + taskID);
-		
-		TaskInterface<?> ti = jobRegistry.getTaskInfo(jobID, taskID) ;
-		try {
-
-			ti.setStatus((int)BrokerConstants.JOB_STATUS_CANCELED);
-			
-			TaskCanceledEvent event = new TaskCanceledEvent(jobID, taskID);
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			schedule(event);
-			
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
 
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-	
-				//log.info(decision.getDocument());
-	
-				String jobID = taskDecision.getJobId();
-				String taskID = taskDecision.getTaskId();
-				
-				// Task allocations that were rejected because of lack of resources or which were canceled and 
-				// not scheduled again are returned to the user.
-				if(taskDecision.getStatus() == AllocationStatus.REJECTED){
-					Job job = jobRegistry.getJob(jobID);
-					scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
-					continue;
-				}
-				
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					Executable exec = jobRegistry.createExecutable(task, allocation);
-					submitWorkloadUnit(exec, allocation);
-					task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
-				}								
-
-			}catch (Exception e){
-				e.printStackTrace();
-			}
-		}
-	}
-
-	protected void submitWorkloadUnit(WorkloadUnit job, AllocationInterface allocation) {
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			//log.info(decision.getDocument());
+
+			String jobID = taskDecision.getJobId();
+			String taskID = taskDecision.getTaskId();
+			
+			// Task allocations that were rejected because of lack of resources or which were canceled and 
+			// not scheduled again are returned to the user.
+			if(taskDecision.getStatus() == AllocationStatus.REJECTED){
+				Job job = jobRegistry.getJob(jobID);
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+				continue;
+			}
+			
+			Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
+			
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				Executable exec = createExecutable(task, allocation);
+				submitTask(exec, allocation);
+				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
+			}								
+		}
+	}
+
+	private Executable createExecutable(Task task, AllocationInterface<?> allocation) {
+
+		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
+		if(refersTo == null)
+			refersTo = task.getId();
+			
+		Executable exec = null;
+
+		if(refersTo.equals(task.getId())){
+			exec = new Executable(task);
+		} else {
+			List<AbstractProcesses> processes = task.getProcesses();
+			if(processes == null) {
+				try {
+					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
+							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+			boolean found = false;
+			for(int j = 0; j < processes.size() && !found; j++){
+				AbstractProcesses procesesSet = processes.get(j);
+				if(refersTo.equals(procesesSet.getId())){
+					exec = new Executable(task, procesesSet);
+					found = true;
+				}
+			}
+			if(!found){
+				log.error("Allocation refers to unknown proceses set.");
+			}
+		}
+
+		exec.setReservationId(allocation.getReservationId());
+			
+		/*HostInterface<?> host = allocation.getHost();
+		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
+		if(crt != null){
+			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
+			if(crti != null){
+				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
+				for(int p = 0; p < properties.length; p++){
+					ParameterPropertyInterface<?> property = properties[p];
+					if("chosenCPUs".equals(property.getName())){
+						Object cpuNames = property.getValue();
+						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
+					}
+				}
+			}
+		}*/
+		return exec;
+	}
+	
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 
 		String providerName = allocation.getProviderName();
@@ -257,14 +264,13 @@
 			return;
 		}
-		TaskInterface<?> task = (TaskInterface<?>) job;
 		removeFromQueue(task);
 		
 		int resID = GridSim.getEntityId(providerName);
-		IO_data data = new IO_data(job, 0, resID);
+		IO_data data = new IO_data(task, 0, resID);
 		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);	
 		
 		//scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);			
 		if(log.isDebugEnabled())
-			log.debug("Submitted job " + job.getId() + " to " + providerName);
+			log.debug("Submitted job " + task.getId() + " to " + providerName);
 
 	}
@@ -274,9 +280,9 @@
 		public void handleJob(Job job){
 
-			jobRegistry.addJob(job);
 			if (log.isInfoEnabled())
 				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
 
-			scheduleReadyTasks(job);
+			jobRegistry.addJob(job);
+			scheduleAvaialbleTasks(job);
 		}
 		
@@ -289,7 +295,4 @@
 		}
 
-		public void handleSubmittedTask(SubmittedTask task) {
-			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
-		}
 	}
 
@@ -297,5 +300,4 @@
 		return new GlobalWorkloadUnitHandler();
 	}
-	
 
 
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 481)
@@ -10,5 +10,4 @@
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.resources.units.StandardResourceUnitName;
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.WorkloadUnitHandler;
@@ -16,6 +15,6 @@
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.resources.ResourceManagerFactory;
+import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
@@ -27,12 +26,12 @@
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -45,15 +44,13 @@
 	protected String name;
 
+	protected TaskQueueList queues;
 	protected ResourceManager resourceManager;
-
-	protected TaskQueueList queues;
-
+	protected JobRegistryImpl jobRegistry;
+	protected ModuleList moduleList;
+	
 	protected SchedulingPlugin schedulingPlugin;
-
 	protected ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
 
-	protected ModuleList moduleList;
-	
-	protected JobRegistryImpl jobRegistry;
+	protected Scheduler scheduler;
 	
 
@@ -67,4 +64,17 @@
 	}
 	
+	public void init(Scheduler sched, ManagedResources managedResources) {
+		scheduler = sched;
+		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
+		scheduler.set_stat(DCWormsConstants.getResourcesStatisticsObject(queues.size()));
+		for(int i = 0; i < queues.size(); i++){
+			TaskQueue q = queues.get(i);
+			if(q instanceof AbstractStatsSupportingQueue<?>){
+				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
+				queue.setStats(scheduler.get_stat(), DCWormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
+			}
+		}
+	}
+	
 	public void processEvent(Sim_event ev) {
 		processOtherEvent(ev);
@@ -81,10 +91,7 @@
 	}
 	
+	
 	public String getName() {
 		return name;
-	}
-
-	public PluginConfiguration getSchedulingPluginConfiguration() {
-		return schedulingPlugin.getConfiguration();
 	}
 	
@@ -106,4 +113,12 @@
 		return jobRegistry;
 	}
+	
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+	
+	public PluginConfiguration getSchedulingPluginConfiguration() {
+		return schedulingPlugin.getConfiguration();
+	}
 
 	public boolean pluginSupportsEvent(int eventType){
@@ -111,16 +126,18 @@
 	}
 
-	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack);
-
-	public abstract void notifyCanceledWorkloadUnit(WorkloadUnit wu);
-
-	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit wu);
-
-	protected abstract void executeSchedulingPlan(SchedulingPlanInterface decision);
-
-
-
+	public TaskQueueList getQueues(){
+		return queues;
+	}
+	
+	public Map<String, Integer> getQueuesSize() {
+		Map<String, Integer> queue_size = new HashMap<String, Integer>();
+		for (TaskQueue queue : queues) {
+			queue_size.put(queue.getName(), queue.size());
+		}
+		return queue_size;
+	}
+	
 	//POPRAWIC  (ale co? bo teraz chyba jest ok)
-	protected void submitWorkloadUnit(WorkloadUnit wu, AllocationInterface allocation) {
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 		String providerName = allocation.getProviderName();
 		if (providerName == null) {
@@ -128,38 +145,6 @@
 		}
 		//Executable exec = (Executable) wu;
-		removeFromQueue(wu);
-		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, wu);	
-	}
-	
-	protected boolean sendCanceledWorkloadUnit(int tag, Executable task, int executableId, int destId) {
-		
-		if (tag != GridSimTags.GRIDLET_CANCEL) {
-			return false;
-		}
-
-		long taskSize = 0;
-		if (task != null) {
-			taskSize = task.getGridletOutputSize();
-		}
-
-		// if no Gridlet found, then create a new Gridlet but set its status
-		// to FAILED. Then, most importantly, set the resource parameters
-		// because the user will search/filter based on a resource ID.
-		else if (task == null) {
-			try {
-				taskSize = 100;
-				task = jobRegistry.getTaskExecutable(executableId);
-				task.setGridletStatus(Gridlet.FAILED);
-				int cost = resourceManager.getSharedResourceUnits().get(StandardResourceUnitName.COST) != null ? resourceManager
-						.getSharedResourceUnits().get(StandardResourceUnitName.COST).get(0).getAmount()
-						: 1;
-				task.setResourceParameter(scheduler.get_id(), cost);
-			} catch (Exception e) {
-				// empty ...
-			}
-		}
-		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, tag,  new IO_data(task, taskSize, destId));
-
-		return true;
+		removeFromQueue(task);
+		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, task);	
 	}
 
@@ -184,10 +169,4 @@
 
 	protected void sendExecutableReadyEvent(ExecTask exec) {
-
-		/*if (wu instanceof JobInterface) {
-			scheduler.sendInternal(Long.valueOf(0).doubleValue(), GssimTags.TASK_READY_FOR_EXECUTION,
-					wu);
-			return;
-		}*/
 
 		long delay = 0;
@@ -202,5 +181,5 @@
 		}
 
-		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), WormsTags.TASK_READY_FOR_EXECUTION,
+		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), DCWormsTags.TASK_READY_FOR_EXECUTION,
 				exec);
 	}
@@ -214,5 +193,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					scheduler.sendInternal(delay, WormsTags.TIMER, null);
+					scheduler.sendInternal(delay, DCWormsTags.TIMER, null);
 				}
 			}
@@ -229,37 +208,12 @@
 		return false;
 	}
-
-	public TaskQueueList getAccessQueues(){
-		return queues;
-	}
-	
-	public Map<String, Integer> getQueuesSize() {
-		Map<String, Integer> queue_size = new HashMap<String, Integer>();
-		for (TaskQueue queue : queues) {
-			queue_size.put(queue.getName(), queue.size());
-		}
-		return queue_size;
-	}
-
-	public void init(Scheduler sched, ManagedResources managedResources) {
-		scheduler = sched;
-		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
-		scheduler.set_stat(WormsConstants.getResourcesStatisticsObject(queues.size()));
-		for(int i = 0; i < queues.size(); i++){
-			TaskQueue q = queues.get(i);
-			if(q instanceof AbstractStatsSupportingQueue<?>){
-				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
-				queue.setStats(scheduler.get_stat(), WormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
-			}
-		}
-	}
-
-	protected Scheduler scheduler;
-
-	public Scheduler getScheduler() {
-		return scheduler;
-	}
 	
 	public abstract WorkloadUnitHandler getWorkloadUnitHandler();
+	
+	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack);
+
+	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit wu);
+
+	protected abstract void executeSchedulingPlan(SchedulingPlanInterface<?> decision);
 
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java	(revision 481)
@@ -0,0 +1,19 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public class TaskListImpl extends ArrayList<TaskInterface<?>> implements TaskList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public TaskListImpl(){
+		super();
+	}
+	
+	public TaskListImpl(int initialSize){
+		super(initialSize);
+	}	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 481)
@@ -2,5 +2,5 @@
 
 import schedframe.scheduling.tasks.Job;
-import schedframe.scheduling.tasks.SubmittedTask;
+
 import schedframe.scheduling.tasks.TaskInterface;
 import gssim.schedframe.scheduling.ExecTask;
@@ -13,5 +13,4 @@
 	
 	public void handleExecutable(ExecTask task);
-	
-	public void handleSubmittedTask(SubmittedTask task);
+
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java	(revision 481)
@@ -13,5 +13,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 public class Cluster extends Scheduler{
@@ -23,5 +23,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -30,5 +30,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
Index: DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 481)
@@ -5,5 +5,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -58,9 +58,9 @@
 		for(int i = 0; i < resourceList.size(); i++){
 			int resourceId = resourceList.get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
@@ -80,9 +80,9 @@
 		for(int i = 0; i < gridBroker.getChildren().size(); i++){
 			int resourceId = gridBroker.getChildren().get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 481)
@@ -5,4 +5,5 @@
 import java.util.List;
 
+import schedframe.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
 import schedframe.scheduling.tasks.TaskInterface;
@@ -11,8 +12,4 @@
 public interface JobRegistry {
 
-	//public List<JobInterface<?>> getActiveJobs();
-
-	//public List<TaskInterface<?>> getActiveTasks();
-	
 	public JobInterface<?> getJobInfo(String jobId);
 
@@ -31,10 +28,10 @@
 
 
-	//public List<SubmittedTask> getSubmittedTasks();
+	public ExecutablesList getExecutableTasks(); 
 	
-	public ExecTask getSubmittedTask(String jobId, String taskId);
+	public ExecTask getExecutable(String jobId, String taskId);
 
 	
-	public List<? extends TaskInterface<?>> getReadyTasks(List<JobInterface<?>> jobsList);
+	public List<? extends TaskInterface<?>> getAvailableTasks(List<JobInterface<?>> jobsList);
 
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 481)
@@ -1,31 +1,20 @@
 package schedframe.scheduling.manager.tasks;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.joda.time.DateTime;
 import org.qcg.broker.schemas.resreqs.ParentType;
 import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
 
 import qcg.shared.constants.BrokerConstants;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.ResourceUnitName;
-import schedframe.scheduling.ResourceHistoryItem;
-import schedframe.scheduling.plan.AllocationInterface;
-import schedframe.scheduling.tasks.AbstractProcesses;
+import schedframe.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
-import simulator.WormsConstants;
 
 public class JobRegistryImpl extends AbstractJobRegistry {
@@ -37,21 +26,17 @@
 	private String context;
 
-	//TO DO - change data structure
-	protected static final List<ExecTask> submittedTasks = Collections.synchronizedList(new ArrayList<ExecTask>());;
-	//protected static final List<ExecTaskInterface> submittedTasks = new CopyOnWriteArrayList<ExecTaskInterface>();
+	//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>();
 
-	public JobRegistryImpl(String context_) {
-		context = context_;
+	public JobRegistryImpl(String context) {
+		this.context = context;
 	}
 
-	/*protected void setContext(String context_) {
-		context = context_;
-	}*/
-
-	public boolean addTask(ExecTask newTask) {
-		if(getSubmittedTask(newTask.getJobId(), newTask.getId()) == null)
-		{
-			synchronized (submittedTasks)  {
-				submittedTasks.add(newTask);
+	public boolean addExecTask(ExecTask newTask) {
+		if(getExecutable(newTask.getJobId(), newTask.getId()) == null) {
+			synchronized (executables)  {
+				executables.add(newTask);
 			}
 			return true;
@@ -60,17 +45,16 @@
 	}
 
+	public ExecutablesList getExecutableTasks() {
+		return executables;
+	}
 	public List<ExecTask> getTasks(int status) {
 		List<ExecTask> taskList = new ArrayList<ExecTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task: submittedTasks) {
+		synchronized (executables)  {
+			for (ExecTask task: executables) {
 				if (task.getStatus() == status) {
-					//SubmittedTask subTask = (SubmittedTask) task;
 					List<String> visitedResource = task.getVisitedResources();
-					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
+					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)) {
 						taskList.add(task);
 					}
-					/*if(subTask.getVisitedResources().contains(context)){
-						taskList.add(subTask);
-					}*/
 				}
 			}
@@ -80,48 +64,22 @@
 
 	public List<ExecTask> getQueuedTasks() {
-		return getTasks(Gridlet.QUEUED);
+		return getTasks(DCWormsTags.QUEUED);
 	}
 	
 	public List<ExecTask> getRunningTasks() {
-		return getTasks(Gridlet.INEXEC);
+		return getTasks(DCWormsTags.INEXEC);
 	}
 	
 	public List<ExecTask> getReadyTasks() {
-		return getTasks(Gridlet.READY);
+		return getTasks(DCWormsTags.READY);
 	}
 	
 	public List<ExecTask> getFinishedTasks() {
-		return getTasks(Gridlet.SUCCESS);
+		return getTasks(DCWormsTags.SUCCESS);
 	}
 	
-	
-	public List<ExecTask> getAllSubmittedTasks() {
-		List<ExecTask> taskList;
-		synchronized (submittedTasks)  {
-			taskList = new ArrayList<ExecTask>(submittedTasks);
-		}
-		return taskList;
-	}
-
-	public List<SubmittedTask> getSubmittedTasks() {
-		List<SubmittedTask> taskList = new ArrayList<SubmittedTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				List<String> visitedResource = subTask.getVisitedResources();
-				if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
-					taskList.add(subTask);
-				}
-				/*if(subTask.getVisitedResources().contains(context)){
-					taskList.add(subTask);
-				}*/
-			}
-		}
-		return taskList;
-	}
-	
-	public ExecTask getSubmittedTask(String jobId, String taskId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
+	public ExecTask getExecutable(String jobId, String taskId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
 				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId)==0) {
 					return task;
@@ -131,9 +89,8 @@
 		return null;
 	}
-	
 
 	@SuppressWarnings("unchecked")
-	public List<Task> getReadyTasks(List<JobInterface<?>> wuList) {
-		List<Task> readyTasks = new ArrayList<Task>();
+	public List<Task> getAvailableTasks(List<JobInterface<?>> wuList) {
+		List<Task> availableTasks = new ArrayList<Task>();
 		List<Task> waitingTasks = new ArrayList<Task>();
 		
@@ -143,195 +100,17 @@
 		}
 
-		readyTasks.addAll(getPrecedenceConstrainedReadyTasks(waitingTasks));
-		return readyTasks;
-	}
-	
-	public Executable getTaskExecutable(Integer executableId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				Executable exec = (Executable)subTask.getGridlet();
-				if (exec.getGridletID() == executableId) {
-					return exec;
-				}
-			}
-		}
-		return null;
-	}
-	
-	public List<Executable> getJobExecutables(String jobId){
-		List<Executable> list = new ArrayList<Executable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < submittedTasks.size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				Executable exec = (Executable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId))
-					list.add(exec);
-			}
-		}
-		return list;
-	}
-	
-	public JobRegistryImpl clone() {
-		JobRegistryImpl jr = null;
-		try {
-			jr = (JobRegistryImpl) super.clone();
-		} catch (CloneNotSupportedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-		return jr;
-	}
-
-	/*public AbstractExecutable getTaskExecutabls(String jobId, String taskId){
-		List<AbstractExecutable> list = new ArrayList<AbstractExecutable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				AbstractExecutable exec = (AbstractExecutable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
-					return exec;
-			}
-		}
-		return null;
-	}*/
-	
-	
-	public Executable createExecutable(Task task, AllocationInterface allocation) {
-
-		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
-		if(refersTo == null)
-			refersTo = task.getId();
-			
-		Executable exec = null;
-
-		if(refersTo.equals(task.getId())){
-			exec = new Executable(task);
-		} else {
-			List<AbstractProcesses> processes = task.getProcesses();
-			if(processes == null) {
-				try {
-					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
-							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				if(refersTo.equals(procesesSet.getId())){
-					exec = new Executable(task, procesesSet);
-					found = true;
-				}
-			}
-			if(!found){
-				log.error("Allocation refers to unknown proceses set.");
-			}
-		}
-		
-	//	exec.setUserID(task.getSenderId());
-		exec.setLength(task.getLength());
-		exec.setReservationId(allocation.getReservationId());
-			
-		/*HostInterface<?> host = allocation.getHost();
-		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
-		if(crt != null){
-			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
-			if(crti != null){
-				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
-				for(int p = 0; p < properties.length; p++){
-					ParameterPropertyInterface<?> property = properties[p];
-					if("chosenCPUs".equals(property.getName())){
-						Object cpuNames = property.getValue();
-						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
-					}
-				}
-			}
-		}*/
-		return exec;
-	}
-	
-
-	public List<Executable> createExecutables(Task task) {
-
-		List<AbstractProcesses> processes = task.getProcesses();
-		
-		List<Executable> executables = new ArrayList<Executable>();
-
-		if(processes == null || processes.size()==0){
-			Executable exec = new Executable(task);
-			exec.setUserID(task.getSenderId());
-			exec.setLength(task.getLength());
-			executables.add(exec);
-		} else {
-
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				Executable exec = new Executable(task, procesesSet);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
-				executables.add(exec);
-			}
-		}
-
-		return  executables;
+		availableTasks.addAll(getPrecedenceConstrainedAvailableTasks(waitingTasks));
+		return availableTasks;
 	}
 
 
-	/**************************************/
-	protected static Map<Integer, Map<String, Object>> history = new HashMap<Integer, Map<String,Object>>();
-	
-	public static Map<Integer, Map<String, Object>> getAllocationHistory(){
-		return history;
-	}
-	
-	public void saveHistory (SubmittedTask submittedTask, int estimatedTime, Map<ResourceUnitName, ResourceUnit> choosenResources){
+	private List<Task> getPrecedenceConstrainedAvailableTasks(List<Task> tasks){
 		
-		/*submittedTask.setEstimatedDuration(estimatedTime);
-
-		DateTime currentTime = new DateTime();
-		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);*/
-
-		ResourceHistoryItem resHistItem = submittedTask.getUsedResources().getLast();
-		DateTime currentTime = new DateTime();
-		Map<String, Object> historyItem = new HashMap<String, Object>();
-		List<ResourceHistoryItem> list = new ArrayList<ResourceHistoryItem>(1);
-		list.add(resHistItem);
-		historyItem.put(WormsConstants.RESOURCES, list);
-		historyItem.put(WormsConstants.START_TIME, currentTime);
-		currentTime = currentTime.plusSeconds(estimatedTime);
-		historyItem.put(WormsConstants.END_TIME, currentTime);
-
-		history.put(Integer.valueOf(submittedTask.getGridletID()), historyItem);
-		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
-		for (ComputingResource resource : pes) {
-			//submittedTask.addToResPath(resource.getName());
-			submittedTask.visitResource(resource.getName());
-			ComputingResource parent = resource.getParent();
-			while (parent != null && !submittedTask.getResPath().contains(parent.getName() + "_")) {
-				submittedTask.addToResPath(parent.getName());
-				parent = parent.getParent();
-			}
-			while (parent != null && !submittedTask.getVisitedResources().contains(parent.getName() + "_")) {
-				submittedTask.visitResource(parent.getName());
-				parent = parent.getParent();
-			}
-		}*/
-	}
-
-	private List<Task> getPrecedenceConstrainedReadyTasks(List<Task> tasks){
+		List<Task> availableTasks = new ArrayList<Task>();
+		int size = tasks.size();
 		
-		List<Task> readyTasks = new ArrayList<Task>();
-
-		int size = tasks.size();
 		for(int i = 0; i < size; i++){
 			int parCnt;
-			int previousTaskReadyCnt = 0;
+			int previousTaskSucceedCnt = 0;
 			Task task = tasks.get(i);
 			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
@@ -341,12 +120,9 @@
 			} catch(Exception e){
 				parCnt = 0;
-				//e.printStackTrace();
 			}
-			if(parCnt == 0)
-			{
-				readyTasks.add(task);
+			if(parCnt == 0){
+				availableTasks.add(task);
 			}
-			else
-			{
+			else {
 				for(int j = 0; j < parCnt; j++){
 					ParentType par = task.getDescription().getWorkflow().getParent(j);
@@ -356,16 +132,16 @@
 						}
 					}
-					previousTaskReadyCnt++;
+					previousTaskSucceedCnt++;
 				}
 				
-				if(previousTaskReadyCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
-					readyTasks.add(task);
-				else if(previousTaskReadyCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
-					readyTasks.add(task);
-				else if (previousTaskReadyCnt == parCnt)
-					readyTasks.add(task);
+				if(previousTaskSucceedCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
+					availableTasks.add(task);
+				else if(previousTaskSucceedCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
+					availableTasks.add(task);
+				else if (previousTaskSucceedCnt == parCnt)
+					availableTasks.add(task);
 			}
 		}		
-		return readyTasks;
+		return availableTasks;
 	}
 	
@@ -380,3 +156,4 @@
 		return false;
 	}
+
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 481)
@@ -13,18 +13,16 @@
 
 
-public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job> */implements JobRegistry, Cloneable{
+public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job>*/ implements JobRegistry, Cloneable{
 	
 	private static final long serialVersionUID = 8409060063583755824L;
+
 	
-	private static Log log = LogFactory.getLog(AbstractJobRegistry.class);
-	
-	protected static final ConcurrentHashMap<String, Job> jobs = new ConcurrentHashMap<String, Job>();
+	protected static final ConcurrentHashMap<String, JobInterface<?>> jobs = new ConcurrentHashMap<String, JobInterface<?>>();
 	
 	protected AbstractJobRegistry(){
-		//log.warn("Methods from JobRegistry interface are not implemented.");
 	}
 	
 	public boolean addJob(JobInterface<?> job) {
-		jobs.put(job.getId(), (Job) job);
+		jobs.put(job.getId(),  job);
 		return true;
 	}
@@ -32,5 +30,5 @@
 	public boolean addTask(TaskInterface<?> task) {
 		if(jobs.containsKey(task.getJobId())){
-			jobs.get(task.getJobId()).add((Task)task);
+			getJob(task.getJobId()).add((Task)task);
 			return true;
 		} else {
@@ -39,15 +37,11 @@
 	}
 
-	public Job getJob(String jobId){
+	public JobInterface<?> getJobInfo(String jobId) {
 		return jobs.get(jobId);
 	}
-	
-	public JobInterface<?> getJobInfo(String jobID) {
-		return jobs.get(jobID);
-	}
 
-	public TaskInterface<?> getTaskInfo(String jobID, String taskId) {
+	public TaskInterface<?> getTaskInfo(String jobId, String taskId) {
 		Task task = null;
-		Job job = jobs.get(jobID);
+		Job job = getJob(jobId);
 		
 		if(job == null)
@@ -57,18 +51,11 @@
 			task = job.getTask(taskId);
 		} catch (NoSuchFieldException e) {
-			log.error(e.getMessage());
 		}
 		return task;
 	}
 	
-	/*public List<JobInterface<?>> getActiveJobs() {
-		log.error("getActiveJobs() not implemented.");
-		return null;
+	public Job getJob(String jobId){
+		return (Job)jobs.get(jobId);
 	}
 
-	public List<TaskInterface<?>> getActiveTasks() {
-		log.error("getActiveTasks() not implemented.");
-		return null;
-	}*/
-
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java	(revision 481)
@@ -0,0 +1,10 @@
+package schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public interface TaskList extends List<TaskInterface<?>>{
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 478)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 481)
@@ -1,13 +1,12 @@
 package schedframe.scheduling.queue;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 import org.joda.time.DateTime;
 
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 
-public class TaskQueue extends AbstractStatsSupportingQueue<WorkloadUnit> implements Queue<WorkloadUnit>{
-
+public class TaskQueue extends AbstractStatsSupportingQueue<TaskInterface<?>> implements Queue<TaskInterface<?>>{
 
 	private static final long serialVersionUID = 6576299222910508209L;
@@ -17,35 +16,30 @@
 	protected boolean supportReservation;
 	
-	
 	public TaskQueue (boolean supportReservation){
-		name = "Queue";
-		priority = 0;
+		this.name = "Queue";
+		this.priority = 0;
 		this.supportReservation = supportReservation;
-
 	}
 	
-	public boolean add(WorkloadUnit wu){
+	public boolean add(TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		return super.add(wu);
+		return super.add(task);
 	}
 	
-	public void add(int pos, WorkloadUnit wu){
+	public void add(int pos, TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		 super.add(pos, wu);
+		 super.add(pos, task);
 	}
 	
 	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
-		//return get(pos).getSubmissionTimeToBroker();
-		return null;
+		return get(pos).getSubmissionTimeToBroker();
 	}
 
@@ -69,35 +63,3 @@
 		return supportReservation;
 	}
-	
-	
-	/*public boolean contains (WorkloadUnitInterface<?> wu) {
-		for(int i = 0; i< size();i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-					return true;
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		return false;
-	}
-	
-	public boolean remove (WorkloadUnitInterface<?> wu) {
-		boolean found = false;
-		int index = 0;
-		for(int i = 0; i< size() && !found;i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-				{
-					found = true;
-					index = i;
-				}
-				
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		remove(index);
-		return true;
-	}*/
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 481)
@@ -471,5 +471,5 @@
 
 	@Override
-	public int getUserID() {
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 481)
@@ -8,5 +8,5 @@
 	public String getId();
 	
-	public int getUserID();
+	public int getUserId();
 	
 	public int getStatus();
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 481)
@@ -88,11 +88,5 @@
 	 */
 	public long getLength();
-	
-	/**
-	 * 
-	 * @param length measured in instructions.
-	 */
-	public void setLength(long length);
-	
+
 	/**
 	 * 
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 481)
@@ -199,5 +199,5 @@
 
 	@Override
-	public int getUserID() {
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 480)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 481)
@@ -178,5 +178,5 @@
 	}
 	
-	public int getUserID(){
+	public int getUserId(){
 		return this.senderId;
 	}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java	(revision 480)
+++ 	(revision )
@@ -1,269 +1,0 @@
-package schedframe.scheduling.tasks;
-
-import gridsim.GridSim;
-import gridsim.Gridlet;
-import gridsim.ResGridlet;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
-
-import java.util.List;
-
-import org.apache.commons.lang.ArrayUtils;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeUtilsExt;
-import org.joda.time.ReadableDuration;
-
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.units.ProcessingElements;
-import schedframe.resources.units.StandardResourceUnitName;
-import schedframe.scheduling.ResourceHistoryItem;
-import schedframe.scheduling.UsedResourceList;
-import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.tasks.requirements.ResourceParameterName;
-
-/**
- * 
- * @author Marcin Krystek
- *
- */
-public class SubmittedTask extends ResGridlet implements ExecTask{
-
-	protected Executable task;
-	protected int estimatedDuration;
-	protected UsedResourceList<ResourceHistoryItem> usedResources;
-	//protected List<String> visitedResources;
-	
-	public SubmittedTask(Executable exec) {
-		super(exec);
-		task = exec;
-		this.usedResources = new UsedResourceList<ResourceHistoryItem>();
-		if(exec.requireReservation())
-			this.reservID_ = Integer.valueOf(exec.getReservationId());
-		//this.visitedResources = new ArrayList<String>();
-	}
-
-	public double getCpuCntRequest() throws NoSuchFieldException {
-		return task.getCpuCntRequest();
-	}
-
-	public DateTime getExecutionEndTime() throws NoSuchFieldException {
-		return task.getExecutionEndTime();
-	}
-
-	public DateTime getExecutionStartTime() throws NoSuchFieldException {
-		return task.getExecutionStartTime();
-	}
-
-	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
-		return task.getExpectedDuration();
-	}
-
-	public int getEstimatedDuration(){
-		return this.estimatedDuration;
-	}
-	
-	public void setEstimatedDuration(int value){
-		this.estimatedDuration = value;
-	}
-	
-	public String getId() {
-		return task.getId();
-	}
-
-	public String getJobId() {
-		return task.getJobId();
-	}
-
-	public long getLength() {
-		return task.getLength();
-	}
-
-	public double getMemoryRequest() throws NoSuchFieldException {
-		return task.getMemoryRequest();
-	}
-
-	public double getParameterDoubleValue(ResourceParameterName parameterName)
-			throws NoSuchFieldException, IllegalArgumentException {
-		return task.getParameterDoubleValue(parameterName);
-	}
-
-	public String getParameterStringValue(ResourceParameterName parameterName)
-			throws NoSuchFieldException, IllegalArgumentException {
-		return task.getParameterStringValue(parameterName);
-	}
-
-	public List<AbstractProcessesGroup> getProcessesGroups() {
-		throw new RuntimeException("Not implemented");
-	}
-	
-	public List<AbstractProcesses> getProcesses(){
-		throw new RuntimeException("Not implemented");
-	}
-	
-	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup){
-		throw new RuntimeException("Not implemented");
-	}
-
-	public int getStatus() {
-		return task.getStatus();
-	}
-
-	public DateTime getSubmissionTimeToBroker() {
-		return task.getSubmissionTimeToBroker();
-	}
-
-	public String getUserDN() {
-		return task.getUserDN();
-	}
-
-	public void setLength(long length) {
-		throw new RuntimeException("Task length should not be changed here.");
-	}
-
-	public void setStatus(int status) throws Exception {
-		task.setStatus(status);
-	}
-
-	public org.qcg.broker.schemas.resreqs.Task getDescription() {
-		return (org.qcg.broker.schemas.resreqs.Task) task.getDescription();
-	}
-
-	public String getDocument() throws Exception {
-		return task.getDocument();
-	}
-	
-	public boolean expectSpecificResource(ResourceParameterName resourceName){
-		return task.expectSpecificResource(resourceName);
-	}
-	
-	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
-		return task.getExpectedSpecificResource(resourceName);
-	}
-
-	public long getWorkloadLogWaitTime() {
-		return task.getWorkloadLogWaitTime();
-	}
-	
-	public void addUsedResources(ResourceHistoryItem usedResources){
-		this.usedResources.add(usedResources);
-	}
-	
-	//public List<Map<ResourceParameterName, ResourceUnit>> getUsedResources(){
-	public UsedResourceList<ResourceHistoryItem> getUsedResources(){
-		return this.usedResources;
-	}
-	
-	public boolean setGridletStatus(int status)
-    {
-        // gets Gridlet's previous status
-        int prevStatus = gridlet_.getGridletStatus();
-
-        // if the status of a Gridlet is the same as last time, then ignore
-        if (prevStatus == status) {
-            return false;
-        }
-
-        boolean success = true;
-        try
-        {
-            double clock = GridSim.clock();   // gets the current clock
-            long sec = DateTimeUtilsExt.currentTimeMillis() / 1000; // time in seconds 
-            clock = Long.valueOf(sec).doubleValue();
-            
-            // sets Gridlet's current status
-            gridlet_.setGridletStatus(status);
-
-            // if a previous Gridlet status is INEXEC
-            if (prevStatus == Gridlet.INEXEC)
-            {
-                // and current status is either CANCELED, PAUSED or SUCCESS
-                if (status == Gridlet.CANCELED || status == Gridlet.PAUSED ||
-                    status == Gridlet.SUCCESS)
-                {
-                    // then update the Gridlet completion time
-                    totalCompletionTime_ += (clock - startExecTime_);
-                    index_ = 0;
-                    return true;
-                }
-            }
-
-            if (prevStatus == Gridlet.RESUMED && status == Gridlet.SUCCESS)
-            {
-                // then update the Gridlet completion time
-                totalCompletionTime_ += (clock - startExecTime_);
-                return true;
-            }
-
-            // if a Gridlet is now in execution
-            if (status == Gridlet.INEXEC ||
-                (prevStatus == Gridlet.PAUSED && status == Gridlet.RESUMED) )
-            {
-            	
-                startExecTime_ = clock;
-                gridlet_.setExecStartTime(startExecTime_);
-        		ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
-        		for (ComputingResource resource : pes) {
-
-        			visitResource(resource.getName());
-        			ComputingResource parent = resource.getParent();
-
-					List<String> visitedResource = getVisitedResources();
-        			while (parent != null && !ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), parent.getName())) {
-        				visitResource(parent.getName());
-        				parent = parent.getParent();
-        			}
-        		}
-            }
-        }
-        catch(Exception e) {
-            success = false;
-        }
-
-        return success;
-    }
-	
-	
-	protected void init() {
-		super.init();
-		double time =  DateTimeUtilsExt.getDateTimeAt(arrivalTime_).getMillis() / 1000;
-		this.gridlet_.setSubmissionTime(time);
-	 }
-
-
-	@Override
-	public boolean isFinished() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-	
-	/*public void addToResPath(String resName){
-		task.addToResPath(resName);
-	}
-	
-	public String getResPath(){
-		return task.getResPath();
-	}*/
-	
-	public void visitResource(String resName){
-		task.visitResource(resName);
-	}
-	
-	public List<String> getVisitedResources(){
-		return task.getVisitedResources();
-	}
-	
-	public boolean isRegistered() {
-		return task.isRegistered();
-	}
-
-	public void register(JobRegistryImpl jobRegistry) {
-		task.register(jobRegistry);
-		//jobRegistry.addTask(this);
-	}
-	
-	@Override
-	public void accept(WorkloadUnitHandler wuh) {
-		wuh.handleSubmittedTask(this);
-	}
-}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 478)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 481)
@@ -4,5 +4,5 @@
 
 import schedframe.DescriptionContainer;
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public interface ScheduledTaskInterface<T> extends DescriptionContainer<T> {
@@ -190,7 +190,7 @@
 	
 
-	public ArrayList<AllocationInterface> getAllocations();
+	public ArrayList<AllocationInterface<?>> getAllocations();
 	
-	public WorkloadUnit getTask();
+	public TaskInterface<?> getTask();
 
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 481)
@@ -99,4 +99,4 @@
 
 
-	public ArrayList<ScheduledTaskInterface> getTasks();
+	public ArrayList<ScheduledTaskInterface<?>> getTasks();
 }
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 481)
@@ -18,10 +18,10 @@
 	public SchedulingPlan(){
 		sp = new org.qcg.broker.schemas.schedulingplan.SchedulingPlan();
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
 	public SchedulingPlan(org.qcg.broker.schemas.schedulingplan.SchedulingPlan value){
 		sp = value;
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
@@ -106,7 +106,7 @@
 
 	
-	protected ArrayList<ScheduledTaskInterface> taskList;
+	protected ArrayList<ScheduledTaskInterface<?>> taskList;
 
-	public ArrayList<ScheduledTaskInterface> getTasks() {
+	public ArrayList<ScheduledTaskInterface<?>> getTasks() {
 
 		return this.taskList;
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 478)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 481)
@@ -6,12 +6,10 @@
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
 
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
 import schedframe.scheduling.plan.ScheduledTimeInterface;
-import schedframe.scheduling.tasks.WorkloadUnit;
-
-
-import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public class ScheduledTask implements ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> {
@@ -22,10 +20,10 @@
 	public ScheduledTask(){
 		t = new org.qcg.broker.schemas.schedulingplan.Task();
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
 	public ScheduledTask(org.qcg.broker.schemas.schedulingplan.Task value){
 		t = value;
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
@@ -178,17 +176,17 @@
 	
 
-	protected WorkloadUnit task;
-	protected ArrayList<AllocationInterface> allocationList;
+	protected TaskInterface<?> task;
+	protected ArrayList<AllocationInterface<?>> allocationList;
 
-	public ScheduledTask(WorkloadUnit task){
+	public ScheduledTask(TaskInterface<?> task){
 		this();
 		this.task = task;
 	}
 
-	public ArrayList<AllocationInterface> getAllocations() {
+	public ArrayList<AllocationInterface<?>> getAllocations() {
 		return this.allocationList;
 	}
 	
-	public WorkloadUnit getTask(){
+	public TaskInterface<?> getTask(){
 		return this.task;
 	}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 481)
@@ -2,5 +2,5 @@
 
 import gridsim.GridSimTags;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -275,5 +275,5 @@
 			if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){
 				String src = event.getSource() != null ? event.getSource() : name;
-				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, WormsTags.UPDATE, src);
+				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src);
 			} else if(parent != null)
 				parent.getEventHandler().handleSchedulingEvent(event);
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 481)
@@ -11,5 +11,5 @@
 import schedframe.scheduling.policy.local.LocalManagementSystem;
 import schedframe.scheduling.queue.TaskQueueList;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 
 
@@ -46,5 +46,5 @@
 			}
 			case LS: {
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
@@ -52,5 +52,5 @@
 
 		default:{
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
Index: DCWoRMS/trunk/src/schedframe/ExecutablesList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 481)
@@ -0,0 +1,154 @@
+package schedframe;
+
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class ExecutablesList implements List<ExecTask> {
+
+	private List<ExecTask> executables;
+	public ExecutablesList (){
+		executables = Collections.synchronizedList(new ArrayList<ExecTask>());
+	}
+
+
+	public List<Executable> getJobExecutables(String jobId){
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public List<Executable> getTaskExecutables(String jobId, String taskId){
+		
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public Executable getTaskExecutable(Integer executableId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
+				Executable exec = (Executable)task;
+				if (exec.getUniqueId() == executableId) {
+					return exec;
+				}
+			}
+		}
+		return null;
+	}
+	
+	
+	public boolean add(ExecTask arg0) {
+		return executables.add(arg0);
+	}
+
+	public void add(int arg0, ExecTask arg1) {
+		executables.add(arg0, arg1);
+	}
+
+	public boolean addAll(Collection<? extends ExecTask> arg0) {
+		return executables.addAll(arg0);
+	}
+
+	public boolean addAll(int arg0, Collection<? extends ExecTask> arg1) {
+		return executables.addAll(arg0, arg1);
+	}
+
+	public void clear() {
+		executables.clear();
+	}
+
+	public boolean contains(Object arg0) {
+		return executables.contains(arg0);
+	}
+
+	public boolean containsAll(Collection<?> arg0) {
+		return executables.containsAll(arg0);
+	}
+
+	public ExecTask get(int arg0) {
+		return executables.get(arg0);
+	}
+
+	public int indexOf(Object arg0) {
+		return indexOf(arg0);
+	}
+
+	public boolean isEmpty() {
+		return executables.isEmpty();
+	}
+
+	public Iterator<ExecTask> iterator() {
+		return executables.iterator();
+	}
+
+	public int lastIndexOf(Object arg0) {
+		return executables.lastIndexOf(arg0);
+	}
+
+	public ListIterator<ExecTask> listIterator() {
+		return executables.listIterator();
+	}
+
+	public ListIterator<ExecTask> listIterator(int arg0) {
+		return executables.listIterator(arg0);
+	}
+
+	public boolean remove(Object arg0) {
+		return executables.remove(arg0);
+	}
+
+	public ExecTask remove(int arg0) {
+		return executables.remove(arg0);
+	}
+
+	public boolean removeAll(Collection<?> arg0) {
+		return executables.removeAll(arg0);
+	}
+
+	public boolean retainAll(Collection<?> arg0) {
+		return executables.retainAll(arg0);
+	}
+
+	public ExecTask set(int arg0, ExecTask arg1) {
+		return executables.set(arg0, arg1);
+	}
+
+	public int size() {
+		return executables.size();
+	}
+
+	public List<ExecTask> subList(int arg0, int arg1) {
+		return executables.subList(arg0, arg1);
+	}
+
+	public Object[] toArray() {
+		return executables.toArray();
+	}
+
+	public <T> T[] toArray(T[] arg0) {
+		return executables.toArray(arg0);
+	}
+	
+}
+
