Changeset 223 for xssim/trunk/src/test/rewolucja/resources/manager/implementation/ResourceManager.java
- Timestamp:
- 04/06/12 11:04:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
xssim/trunk/src/test/rewolucja/resources/manager/implementation/ResourceManager.java
r187 r223 22 22 import test.rewolucja.resources.UnitState; 23 23 import test.rewolucja.resources.exception.ResourceException; 24 import test.rewolucja.resources.logical. LogicalResource;24 import test.rewolucja.resources.logical.base.LogicalResource; 25 25 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface; 26 26 import test.rewolucja.resources.physical.base.ComputingResource; … … 32 32 //private Log log = LogFactory.getLog(ResourceManager.class); 33 33 34 protected List<ComputingResource> resources;35 protected List<LogicalResource> logicalResource ;34 protected List<ComputingResource> compResources; 35 protected List<LogicalResource> logicalResources; 36 36 protected ResourceCharacteristics resourceCharacteristic; 37 37 38 public ResourceManager(List<ComputingResource> resources, List<LogicalResource> logical Layers) {39 this. resources = resources;40 this.logicalResource = logicalLayers;38 public ResourceManager(List<ComputingResource> resources, List<LogicalResource> logicalRes) { 39 this.compResources = resources; 40 this.logicalResources = logicalRes; 41 41 this.resourceCharacteristic = new ResourceCharacteristics(); 42 42 for(ComputingResource resource : resources){ … … 53 53 54 54 public ResourceManager(ComputingResource resource) { 55 this. resources = resource.getChildren();55 this.compResources = resource.getChildren(); 56 56 this.resourceCharacteristic = resource.getResourceCharacteristic(); 57 57 // this.logicalLayers = resource.getLogaicaLayer().getChildren(); … … 59 59 60 60 public List<ComputingResource> getResources() { 61 return resources;61 return compResources; 62 62 } 63 63 64 64 public boolean areResourcesAchievable(ResourceType type) { 65 if ( resources != null) {65 if (compResources != null) { 66 66 Stack<ComputingResource> toExamine = new Stack<ComputingResource>(); 67 for (ComputingResource resource : resources)67 for (ComputingResource resource : compResources) 68 68 toExamine.push(resource); 69 69 … … 89 89 public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException { 90 90 List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>(); 91 for (ComputingResource resource : resources) {91 for (ComputingResource resource : compResources) { 92 92 if (resource.getType() == type) { 93 93 resourcesOfType.add(resource); … … 102 102 103 103 List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>(); 104 for (ComputingResource resource : resources) {104 for (ComputingResource resource : compResources) { 105 105 if (resource.getType() == type) { 106 106 if (resource.getStatus() == status) { … … 116 116 117 117 ComputingResource resourceWithName = null; 118 for (int i = 0; i < resources.size() && resourceWithName == null; i++) {119 ComputingResource resource = resources.get(i);118 for (int i = 0; i < compResources.size() && resourceWithName == null; i++) { 119 ComputingResource resource = compResources.get(i); 120 120 if (resource.getName().compareTo(resourceName) == 0) 121 121 resourceWithName = resource; … … 129 129 List<ResourceUnit> resourceUnit = new ArrayList<ResourceUnit>(); 130 130 Stack<ComputingResource> toExamine = new Stack<ComputingResource>(); 131 for (ComputingResource resource : resources)131 for (ComputingResource resource : compResources) 132 132 toExamine.push(resource); 133 133 while (!toExamine.isEmpty()) { … … 169 169 public List<? extends ComputingResource> filterResources(Properties properties) { 170 170 List<ComputingResource> descendants = new ArrayList<ComputingResource>(); 171 for (ComputingResource resource : resources) {171 for (ComputingResource resource : compResources) { 172 172 ResourceValidator resourceValidator = new ResourcePropertiesValidator(properties); 173 173 if (resourceValidator.validate(resource)) … … 180 180 181 181 public List<LogicalResource> getResourceProviders() { 182 return logicalResource ;182 return logicalResources; 183 183 } 184 184 … … 188 188 } 189 189 ComputingResource resourceWithName = null; 190 for(int i = 0 ; i < resources.size() && resourceWithName == null; i++){191 ComputingResource resource = resources.get(i);190 for(int i = 0 ; i < compResources.size() && resourceWithName == null; i++){ 191 ComputingResource resource = compResources.get(i); 192 192 if(resource.getName().equals(resName)) 193 193 resourceWithName = resource;
Note: See TracChangeset
for help on using the changeset viewer.