synchronized AllocatedSlice removeAllocatedSlice ( final AllocationID allocationID ) { final AllocatedSlice slice = this . allocatedSlices . remove ( allocationID ) ; if ( slice != null ) { this . remainingCapacity = InstanceTypeFactory . construct ( this . remainingCapacity . getIdentifier ( ) , this . remainingCapacity . getNumberOfComputeUnits ( ) + slice . getType ( ) . getNumberOfComputeUnits ( ) , this . remainingCapacity . getNumberOfCores ( ) + slice . getType ( ) . getNumberOfCores ( ) , this . remainingCapacity . getMemorySize ( ) + slice . getType ( ) . getMemorySize ( ) , this . remainingCapacity . getDiskCapacity ( ) + slice . getType ( ) . getDiskCapacity ( ) , this . remainingCapacity . getPricePerHour ( ) ) ; } return slice ; }
Removes the slice identified by the given allocation ID from this instance and frees up the allocated resources .