-########################################################################
-# Class ProcessFactory
-########################################################################
-
-class ProcessFactory
-
-# Attributes
- attr_accessor :args, :properties, :hostName, :function
-# Initialize
- def initialize()
-
- @args = Array.new
- @properties = Hash.new
- @hostName = nil
- @function = nil
-
- end
-
-# setProcessIdentity
- def setProcessIdentity(hostName,function)
- @hostName = hostName
- @function = function
-
- if !args.empty?
- args.clear
- end
-
- if !properties.empty?
- properties.clear
- end
-
- end
-
- def registerProcessArg(arg)
- @args.push(arg)
- end
-
-# CreateProcess
- def createProcess()
- process = rubyNewInstance(@function)
- size = @args.size
- for i in 0..size-1
- process.pargs.push(@args[i])
- end
- process.name = @function
- host = Host.getByName(@hostName)
- processCreate(process,host)
- process.properties = @properties
- @properties = Hash.new
-
- end
-
-# SetProperty
- def setProperty(id,value)
- @properties[id] = value
- end
-end
-