Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fd13dbae5c813fd0cef6ac8067a062fdf28ed4ef
[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      #Nothing todo
12   end
13   
14     #  onStartDocument
15   def onStartDocument()
16     
17     @processFactory = ProcessFactory.new
18     if ($DEBUG)
19       puts "onStartDocument"
20     end
21       
22   end
23   
24 #   onBeginProcess
25   def onBeginProcess(hostName,function)
26     
27     @processFactory.setProcessIdentity(hostName,function)
28     
29      if ($DEBUG)
30       puts "onBeginProcess"
31      end
32     
33   end
34
35 #   onProperty
36     def onProperty(id,value)
37     
38     @processFactory.setProperty(id,value)
39     
40      if ($DEBUG)
41       puts "onProperty"
42      end
43     
44   end
45   
46 #   RegisterProcessArg
47     def onProcessArg(arg)
48     
49     @processFactory.registerProcessArg(arg)
50       
51       if ($DEBUG)
52       puts "onProcessArg"
53       end
54     
55   end
56
57 #   OnEndProcess
58    def onEndProcess()
59    
60    @processFactory.createProcess()
61    
62    if ($DEBUG)
63       puts "onEndProcess"
64    end
65       
66  end
67
68  #  onEndDocument
69   def onEndDocument()  
70 #    Euh...Actually Nothin' to Do !!
71    
72    if($DEBUG)
73    puts "onEndDocument"
74    end
75  end
76  
77  #  End Class
78  end
79