[104] | 1 | package test.rewolucja.scheduling.plan; |
---|
| 2 | |
---|
| 3 | import java.util.Map; |
---|
| 4 | |
---|
| 5 | import javax.jws.soap.SOAPBinding.Use; |
---|
| 6 | |
---|
| 7 | import schedframe.resources.units.Memory; |
---|
| 8 | import schedframe.resources.units.ResourceUnit; |
---|
| 9 | import schedframe.scheduling.plan.impl.Allocation; |
---|
| 10 | import schedframe.scheduling.utils.ResourceParameterName; |
---|
| 11 | import test.rewolucja.resources.ProcessingElements; |
---|
| 12 | import test.rewolucja.resources.ResourceStatus; |
---|
| 13 | import test.rewolucja.resources.UnitState; |
---|
| 14 | import test.rewolucja.resources.manager.implementation.ResourceManager; |
---|
| 15 | import test.rewolucja.resources.manager.utils.ResourceManagerUtils; |
---|
| 16 | import test.rewolucja.resources.physical.base.ComputingResource; |
---|
| 17 | |
---|
| 18 | public class AllocationNew extends Allocation implements AllocationInterfaceNew { |
---|
| 19 | |
---|
| 20 | protected Map<ResourceParameterName, ResourceUnit> requestedResources; |
---|
| 21 | protected boolean isProcessing = false; |
---|
| 22 | protected String providerName; |
---|
| 23 | |
---|
| 24 | @Override |
---|
| 25 | public void setSpecificResources( |
---|
| 26 | Map<ResourceParameterName, ResourceUnit> choosenResources) { |
---|
| 27 | requestedResources = choosenResources; |
---|
| 28 | ResourceManagerUtils.setPendingResources(choosenResources); |
---|
| 29 | ProcessingElements processingElements = (ProcessingElements)requestedResources.get(ResourceParameterName.PROCESSINGELEMENTS); |
---|
| 30 | if(processingElements != null){ |
---|
| 31 | isProcessing = true; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | @Override |
---|
| 38 | public Map<ResourceParameterName, ResourceUnit> getRequestedResources() { |
---|
| 39 | return this.requestedResources; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | public boolean isProcessing(){ |
---|
| 43 | return isProcessing; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | @Override |
---|
| 49 | public void setProviderName(String providerName) { |
---|
| 50 | this.providerName = providerName; |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | @Override |
---|
| 54 | public String getProviderName() { |
---|
| 55 | return providerName; |
---|
| 56 | } |
---|
| 57 | } |
---|