Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
First version of ruby bindings by Medhi
[simgrid.git] / src / bindings / ruby / ApplicationHandler.rb
1 require 'ProcessFactory'
2
3 $debug = true
4
5 class ApplicationHandler
6
7   @processFactory
8   
9 #   Initialize
10   def initialize()
11      
12   end
13   
14     
15 #  onStartDocument
16   def onStartDocument()
17     
18     @processFactory = ProcessFactory.new
19     
20     if ($debug)
21       puts "onStartDocument"
22     end
23       
24     
25   end
26   
27 #   onBeginProcess
28   def onBeginProcess (hostName ,function)
29     
30     @processFactory.setProcessIdentity(hostName,function)
31     
32      if ($debug)
33       puts "onBeginProcess"
34      end
35     
36   end
37
38 #   onProperty
39   
40   def onProperty(id,value)
41     
42     @processFactory.setProperty(id,value)
43     
44      if ($debug)
45       puts "onProperty"
46      end
47     
48   end
49   
50 #   RegisterProcessArg
51   
52   def onProcessArg(arg)
53     
54     @processFactory.registerProcessArg(arg)
55       
56       if ($debug)
57       puts "onProcessArg"
58       end
59     
60   end
61
62 #   OnEndProcess
63   
64  def onEndProcess()
65    
66    @processFactory.createProcess()
67    
68    if ($debug)
69       puts "onEndProcess"
70    end
71       
72  end
73
74
75  #  onEndDocument
76  
77  def onEndDocument()  
78 #    Euh...Actually Nothin' to Do !!
79    
80    if($debug)
81    puts "onEndDocument"
82    end
83  end
84   
85  
86 #  End Class
87  
88 end
89