protected void processCloudlet(SimEvent ev,int type){
  int cloudletId=0;
  int userId=0;
  int vmId=0;
  int containerId=0;
  try {
    int data[]=(int[])ev.getData();
    cloudletId=data[0];
    userId=data[1];
    vmId=data[2];
    containerId=data[3];
  }
 catch (  ClassCastException c) {
    try {
      ContainerCloudlet cl=(ContainerCloudlet)ev.getData();
      cloudletId=cl.getCloudletId();
      userId=cl.getUserId();
      vmId=cl.getVmId();
      containerId=cl.getContainerId();
    }
 catch (    Exception e) {
      Log.printConcatLine(super.getName(),": Error in processing Cloudlet");
      Log.printLine(e.getMessage());
      return;
    }
  }
catch (  Exception e) {
    Log.printConcatLine(super.getName(),": Error in processing a Cloudlet.");
    Log.printLine(e.getMessage());
    return;
  }
switch (type) {
case CloudSimTags.CLOUDLET_CANCEL:
    processCloudletCancel(cloudletId,userId,vmId,containerId);
  break;
case CloudSimTags.CLOUDLET_PAUSE:
processCloudletPause(cloudletId,userId,vmId,containerId,false);
break;
case CloudSimTags.CLOUDLET_PAUSE_ACK:
processCloudletPause(cloudletId,userId,vmId,containerId,true);
break;
case CloudSimTags.CLOUDLET_RESUME:
processCloudletResume(cloudletId,userId,vmId,containerId,false);
break;
case CloudSimTags.CLOUDLET_RESUME_ACK:
processCloudletResume(cloudletId,userId,vmId,containerId,true);
break;
default :
break;
}
}

protected void processCloudlet ( SimEvent ev , int type ) { int cloudletId = 0 ; int userId = 0 ; int vmId = 0 ; int containerId = 0 ; try { int data [ ] = ( int [ ] ) ev . getData ( ) ; cloudletId = data [ 0 ] ; userId = data [ 1 ] ; vmId = data [ 2 ] ; containerId = data [ 3 ] ; } catch ( ClassCastException c ) { try { ContainerCloudlet cl = ( ContainerCloudlet ) ev . getData ( ) ; cloudletId = cl . getCloudletId ( ) ; userId = cl . getUserId ( ) ; vmId = cl . getVmId ( ) ; containerId = cl . getContainerId ( ) ; } catch ( Exception e ) { Log . printConcatLine ( super . getName ( ) , ": Error in processing Cloudlet" ) ; Log . printLine ( e . getMessage ( ) ) ; return ; } } catch ( Exception e ) { Log . printConcatLine ( super . getName ( ) , ": Error in processing a Cloudlet." ) ; Log . printLine ( e . getMessage ( ) ) ; return ; } switch ( type ) { case CloudSimTags . CLOUDLET_CANCEL : processCloudletCancel ( cloudletId , userId , vmId , containerId ) ; break ; case CloudSimTags . CLOUDLET_PAUSE : processCloudletPause ( cloudletId , userId , vmId , containerId , false ) ; break ; case CloudSimTags . CLOUDLET_PAUSE_ACK : processCloudletPause ( cloudletId , userId , vmId , containerId , true ) ; break ; case CloudSimTags . CLOUDLET_RESUME : processCloudletResume ( cloudletId , userId , vmId , containerId , false ) ; break ; case CloudSimTags . CLOUDLET_RESUME_ACK : processCloudletResume ( cloudletId , userId , vmId , containerId , true ) ; break ; default : break ; } }
processes a cloudlet based on the event type .
