hu.mta.sztaki.lpds.cloud.simulator.iaas
Class PhysicalMachine.ResourceAllocation

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.DeferredEvent
      extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.PhysicalMachine.ResourceAllocation
All Implemented Interfaces:
VirtualMachine.StateChange
Enclosing class:
PhysicalMachine

public class PhysicalMachine.ResourceAllocation
extends DeferredEvent
implements VirtualMachine.StateChange


Field Summary
 ResourceConstraints allocated
           
private  int myPromisedIndex
           
private  ResourceConstraints realAllocated
           
private  boolean swept
           
private  VirtualMachine user
           
 
Constructor Summary
private PhysicalMachine.ResourceAllocation(ResourceConstraints realAlloc, ResourceConstraints alloc, int until)
           
 
Method Summary
 void cancel()
           
protected  void eventAction()
           
 PhysicalMachine getHost()
           
 boolean isAvailable()
           
 boolean isUnUsed()
           
private  void promisedCapacityUpdater()
           
(package private)  void release()
           
 void stateChanged(VirtualMachine vm, VirtualMachine.State oldState, VirtualMachine.State newState)
          If the state of a VM is changed this function is called on all subscribing implementations.
 String toString()
           
(package private)  void use(VirtualMachine vm)
           
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.DeferredEvent
isCancelled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

allocated

public final ResourceConstraints allocated

realAllocated

private final ResourceConstraints realAllocated

user

private VirtualMachine user

myPromisedIndex

private final int myPromisedIndex

swept

private boolean swept
Constructor Detail

PhysicalMachine.ResourceAllocation

private PhysicalMachine.ResourceAllocation(ResourceConstraints realAlloc,
                                           ResourceConstraints alloc,
                                           int until)
Method Detail

eventAction

protected void eventAction()
Specified by:
eventAction in class DeferredEvent

promisedCapacityUpdater

private void promisedCapacityUpdater()

cancel

public void cancel()
Overrides:
cancel in class DeferredEvent

use

void use(VirtualMachine vm)
   throws VMManager.VMManagementException
Throws:
VMManager.VMManagementException

stateChanged

public void stateChanged(VirtualMachine vm,
                         VirtualMachine.State oldState,
                         VirtualMachine.State newState)
Description copied from interface: VirtualMachine.StateChange
If the state of a VM is changed this function is called on all subscribing implementations.

Specified by:
stateChanged in interface VirtualMachine.StateChange
oldState - the state before the change was issued
newState - the state after the change took effect

release

void release()

isUnUsed

public boolean isUnUsed()

isAvailable

public boolean isAvailable()

toString

public String toString()
Overrides:
toString in class Object

getHost

public PhysicalMachine getHost()


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.