Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stuks When a process ( Slave ) Tries to Recieve a Task...
[simgrid.git] / src / bindings / ruby / ApplicationHandler.rb
1
2 #  * $Id$
3 #  *
4 #  * Copyright 2010 Martin Quinson, Mehdi Fekari           
5 #  * All right reserved. 
6 #  *
7 #  * This program is free software; you can redistribute 
8 #  * it and/or modify it under the terms of the license 
9 #  *(GNU LGPL) which comes with this package. 
10 require 'ProcessFactory'
11 $DEBUG = false
12 class ApplicationHandler
13
14   @processFactory  
15 #   Initialize
16   def initialize()
17      #Nothing todo
18   end
19   
20     #  onStartDocument
21   def onStartDocument()
22     
23     @processFactory = ProcessFactory.new
24     if ($DEBUG)
25       puts "onStartDocument"
26     end
27       
28   end
29   
30 #   onBeginProcess
31   def onBeginProcess(hostName,function)
32     
33     @processFactory.setProcessIdentity(hostName,function)
34     
35      if ($DEBUG)
36       puts "onBeginProcess"
37      end
38     
39   end
40
41 #   onProperty
42     def onProperty(id,value)
43     
44     @processFactory.setProperty(id,value)
45     
46      if ($DEBUG)
47       puts "onProperty"
48      end
49     
50   end
51   
52 #   RegisterProcessArg
53     def onProcessArg(arg)
54     
55     @processFactory.registerProcessArg(arg)
56       
57       if ($DEBUG)
58       puts "onProcessArg"
59       end
60     
61   end
62
63 #   OnEndProcess
64    def onEndProcess()
65    
66    @processFactory.createProcess()
67    
68    if ($DEBUG)
69       puts "onEndProcess"
70    end
71       
72  end
73
74  #  onEndDocument
75   def onEndDocument()  
76 #    Euh...Actually Nothin' to Do !!
77    
78    if($DEBUG)
79    puts "onEndDocument"
80    end
81  end
82  
83  #  End Class
84  end