Index: /DCWoRMS/branches/coolemall/src/gridsim/dcworms/DCWormsTags.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/gridsim/dcworms/DCWormsTags.java	(revision 1362)
+++ /DCWoRMS/branches/coolemall/src/gridsim/dcworms/DCWormsTags.java	(revision 1374)
@@ -57,12 +57,20 @@
     public static final int NEW_EXEC_PHASE = 5;
     
-    public static final int PAUSED = 6;
+    public static final int PAUSING = 6;
+    
+    public static final int PAUSED = 7;
 
-    public static final int RESUMED = 7;
+    public static final int RESUMING = 8;
     
-    public static final int SUCCESS = 8;
+    public static final int RESUMED = 9;
+    
+    public static final int IN_MIGRATION = 10;
+    
+    public static final int SUCCESS = 11;
 
-    public static final int CANCELED = 9;
+    public static final int CANCELED = 12;
 
-    public static final int FAILED = 10;
+    public static final int FAILED = 13;
+    
+
 }
Index: /DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java	(revision 1346)
+++ /DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java	(revision 1374)
@@ -376,12 +376,10 @@
 			for(String resourceName : resIdList){
 				ComputingResource computingResource;
-				try {
-					if(mainCompRes.getFullName().contains(resourceName))
-						computingResource = mainCompRes;
-					else
-						computingResource = mainCompRes.getDescendantByName(resourceName);
-				} catch (ResourceException e) {
-					continue;
-				}
+
+				if(mainCompRes.getFullName().contains(resourceName))
+					computingResource = mainCompRes;
+				else
+					computingResource = mainCompRes.getDescendantByName(resourceName);
+
 				if(computingResource != null)
 				{
Index: /DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 1362)
+++ /DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 1374)
@@ -955,12 +955,8 @@
 		int cnt = 0;
 		for(String resName: basicStats.keySet()){
-			try {
-				if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){
-					createResourceLoadData(usageStats, basicStats.get(resName));
-					cnt++;
-				}
-			} catch (ResourceException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
+
+			if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){
+				createResourceLoadData(usageStats, basicStats.get(resName));
+				cnt++;
 			}
 		}
@@ -1593,13 +1589,8 @@
 		for(String resName: peLoad.keySet()){
 
-			try {
-				if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){
-					Double load = peLoad.get(resName);
-					sum += load;
-					peCnt++;
-				}
-			} catch (ResourceException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
+			if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){
+				Double load = peLoad.get(resName);
+				sum += load;
+				peCnt++;
 			}
 		}
Index: /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 1362)
+++ /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 1374)
@@ -11,4 +11,5 @@
 import schedframe.resources.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.utils.ResourceManagerUtils;
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
@@ -65,5 +66,5 @@
 	public List<JobInterface<?>> getJobs(){
 		List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>();
-		for(String jobId:jobs.keySet()) {
+		for(String jobId: jobs.keySet()) {
 			jobList.add(jobs.get(jobId));
 		}
@@ -74,5 +75,5 @@
 		List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>();
 		synchronized (jobs) {
-			for(String jobId:jobs.keySet()){
+			for(String jobId: jobs.keySet()){
 				JobInterface<?> job = jobs.get(jobId);
 				if (job.getStatus() == status) {
@@ -90,4 +91,10 @@
 			return false;
 		}else{
+			try {
+				execTask.setStatus(DCWormsTags.PAUSING);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
 			String[] ids = new String[2];
 			ids[0] = new String(jobId);
@@ -116,4 +123,12 @@
 			return false;
 		}else{
+			try {
+				execTask.setStatus(DCWormsTags.IN_MIGRATION);
+			} catch (Exception e) {
+				return false;
+			}
+			if(choosenResources != null){
+				ResourceManagerUtils.setPendingResources(choosenResources);
+			}
 			Object[] data = new Object[3];
 			data[0] = new String(jobId);
Index: /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1280)
+++ /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1374)
@@ -134,5 +134,5 @@
 	}
 
-	public ComputingResource getResourceByName(String resourceName) throws ResourceException {
+	public ComputingResource getResourceByName(String resourceName) {
 		ComputingResource resourceWithName = null;
 		for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) {
@@ -269,9 +269,6 @@
 				resourceWithName = resource;
 			else
-				try {
-					resourceWithName = resource.getDescendantByName(resName);
-				} catch (ResourceException e) {
-					return null;
-				}
+				resourceWithName = resource.getDescendantByName(resName);
+
 		}
 		if(resourceWithName == null)
Index: /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceManager.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 517)
+++ /DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 1374)
@@ -19,5 +19,5 @@
 	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException;
 
-	public ComputingResource getResourceByName(String resourceName) throws ResourceException;
+	public ComputingResource getResourceByName(String resourceName);
 
 	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status) throws ResourceException;
Index: /DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java	(revision 1207)
+++ /DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java	(revision 1374)
@@ -229,9 +229,7 @@
 			if(w.getAnd() != null) {
 				parCnt = w.getAnd().getParentOpTypeItemCount();
-				if(parCnt == 0)
-				{
+				if(parCnt == 0){
 					availableTasks.add(task);
-				}
-				else
+				}else
 				{
 					for(int j = 0; j < parCnt; j++){
@@ -251,10 +249,8 @@
 			else if(w.getOr() != null) {
 				parCnt = w.getOr().getParentOpTypeItemCount();
-				if(parCnt == 0)
-				{
+				if(parCnt == 0){
 					availableTasks.add(task);
 				}
-				else
-				{
+				else{
 					for(int j = 0; j < parCnt; j++){
 						ParentType par = w.getOr().getParentOpTypeItem(j).getParent();
@@ -273,10 +269,7 @@
 			else {
 				parCnt = w.getParentCount();
-				if(parCnt == 0)
-				{
+				if(parCnt == 0){
 					availableTasks.add(task);
-				}
-				else
-				{
+				}else{
 					for(int j = 0; j < parCnt; j++){
 						ParentType par = w.getParent(j);
Index: /DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1362)
+++ /DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1374)
@@ -213,4 +213,11 @@
 			if (pluginSupportsEvent(tag)) {
 				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.POWER_LIMIT_EXCEEDED);
+				String source;
+				try{
+					source = ev.get_data().toString();
+				} catch(Exception e){
+					source = null;
+				}
+				event.setSource(source);
 				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
@@ -412,4 +419,5 @@
 		getAllocationManager().freeResources(lastUsed);
 		
+		//TODO calculate the value of completion
 		saveExecutionHistory(exec, 100,0);
 		
@@ -556,8 +564,6 @@
 		LocalResourceManager resourceManager = getResourceManager();
 		if(resourceName != null){
-			ComputingResource resource = null;
-			try {
-				resource = resourceManager.getResourceByName(resourceName);
-			} catch (ResourceException e) {
+			ComputingResource resource = resourceManager.getResourceByName(resourceName);
+			if(resource == null){
 				return null;
 			}
Index: /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1321)
+++ /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1374)
@@ -64,5 +64,5 @@
 	}
 
-	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException {
+	public List<PowerState> getSupportedPowerStates(){
 		List<PowerState> powerStates = new ArrayList<PowerState>();
 		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
@@ -74,5 +74,5 @@
 	public boolean supportPowerState(PowerStateName state) {
 		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-			if(powerState.getName().equals(state)){
+			if(powerState.getName().getName().equals(state.getName())){
 				return true;
 			}
@@ -86,5 +86,5 @@
 		if(supportPowerState(state)){
 			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-				if(powerState.getName().equals(state)){
+				if(powerState.getName().getName().equals(state.getName())){
 					powerConsumption = powerState.getPowerUsage();
 					break;
Index: /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1330)
+++ /DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1374)
@@ -158,5 +158,5 @@
 	}
 
-	public ComputingResource getDescendantByName(String resourceName) throws ResourceException {
+	public ComputingResource getDescendantByName(String resourceName){
 		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
 		validators.add(new ResourceNameValidator(resourceName));
