-#########################################################################
-# Class ApplicationHandler
-#########################################################################
-class ApplicationHandler
- def initialize()
- @hostName = nil
- @function = nil
- end
-
- def onBeginProcess(hostName,function)
- @args = Array.new
- @properties = Hash.new
-
- @hostName = hostName
- @function = function
-
- MSG::debug("onBeginProcess("+hostName+","+function+")")
- end
-
- def onProperty(id,value)
- @properties[id] = value
- end
-
- def onProcessArg(arg)
- @args.push(arg)
- end
-
- def onEndProcess()
- # must be in C, called from a callback to the FlexML parser
- # newInstance must take args and hostname as argument to initialize everything, *and* bind it to C element
- # Allows to mark all attributes of process (but properties) to read-only
- process = MSG::rubyNewInstance(@function)
- process.pargs = @args
- process.name = @function
- host = MSG::Host.getByName(@hostName)
- MSG::processCreate(process,host)
- process.properties = @properties
- end
-end
-