/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simizer.processor.tasks;

import simizer.Node;
import simizer.VM;
import simizer.requests.Request;

/**
 * This is default request sending task.
 * It does not wait for an answer.
 * There are three ways of sending requests
 * 
 * 
 * @author Sylvain Lefebvre
 */
public class SendTask extends IOTask {
    private final Request r;
    private final Node dest;
    
     public SendTask(Request r, Node dest) {
         super( r.getSize());
         this.r = r;
         this.dest = dest;
     }
     public Request getRequest() {
         return this.r;
     }

    public Node getTgt() {
       return dest;
    }

   
    @Override
    public void startTask(VM vm, long timestamp) {
        if(r.getArTime() ==-1) {
                    r.setArtime(timestamp);
                    
                } else {
                    r.setFinishTime(timestamp);
                }
        TaskSession ts = super.getTaskSession();
        if(ts.isComplete())
            vm.endTaskSession(ts, timestamp);
        vm.send(dest, r, timestamp);
    }
             
}

@@ -1,104 +1,4 @@
-/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0A
 pack
@@ -145,19 +145,16 @@
 ng task.
-%0A *
  It does
@@ -181,17 +181,17 @@
 wer.
-%0A *
  There
+%0A *
  are
@@ -224,21 +224,19 @@
 uests%0A *
- 
 %0A *
- 
 %0A * @aut
@@ -299,18 +299,17 @@
 OTask %7B%0A
-  
+%0A
   privat
@@ -329,18 +329,16 @@
 st r;%0A  
- 
- 
 private 
@@ -354,24 +354,17 @@
 e dest;%0A
-    %0A   
+%0A
   public
@@ -393,29 +393,24 @@
 ode dest) %7B%0A
-     
     super( r
@@ -407,17 +407,16 @@
   super(
- 
 r.getSiz
@@ -421,21 +421,17 @@
 ize());%0A
-     
+%0A
     this
@@ -438,21 +438,16 @@
 .r = r;%0A
-     
     this
@@ -462,24 +462,19 @@
 dest;%0A  
-   %7D%0A   
+%7D%0A%0A
   public
@@ -493,29 +493,24 @@
 Request() %7B%0A
-     
     return t
@@ -520,18 +520,13 @@
 .r;%0A
-   
   %7D%0A%0A
-  
   pu
@@ -550,19 +550,16 @@
 ) %7B%0A    
-  
- 
 return d
@@ -567,21 +567,13 @@
 st;%0A
-  
   %7D%0A%0A
-   %0A  
   @O
@@ -580,18 +580,16 @@
 verride%0A
-  
   public
@@ -629,26 +629,23 @@
 tamp) %7B%0A
-    
     if
+ 
 (r.getAr
@@ -657,28 +657,15 @@
 ) ==
+ 
 -1) %7B%0A
-              
     
@@ -698,64 +698,17 @@
     
-                %0A                %7D else %7B%0A              
+%7D else %7B%0A
     
@@ -741,30 +741,15 @@
 p);%0A
-            
     %7D%0A
-    
+%0A
     
@@ -793,18 +793,15 @@
 ();%0A
-    
     if
+ 
 (ts.
@@ -813,23 +813,19 @@
 plete())
-%0A      
+ %7B%0A
       vm
@@ -856,24 +856,26 @@
 stamp);%0A    
+%7D%0A
     vm.send(
@@ -901,24 +901,8 @@
 ;%0A  
-  %7D%0A             
+%7D
 %0A%7D%0A

Update SendTask to conform to the GSG.