- @properties = Hash.new()
- @id = @@nextProcessId++
-
- argc = args.size
-
- if argc == 0 # Default initializer
- super() {
- @id = 0
- @bind = 0
- @name = ""
- @pargs = Array.new()
- start()
- debug "Initializer without any argument"
- }
-
- # 2 arguments: (HostName,Name) Or (Host , Name)
- elsif argc == 2
- super(){
- debug "Initilize with 2 args"
- type = args[0].type()
- if ( type.to_s == "String")
- host = Host.getByName(args[0])
- elsif ( type.to_s == "MSG::Host")
- host = args[0]
- else
- raise "first argument of type "+args[0].type().to_s+", but expecting either String or MSG::Host"
- end
- if $DEBUG
- puts host
- end
- raise "Process name cannot be null" if args[1].empty?
- @name = args[1]
- if $DEBUG
- puts @name
- end
- @pargs = Array.new() # No Args[] Passed in Arguments
- start()
- createProcess(self,host)
- }
-
- # 3 arguments: (hostName,Name,args[]) or (Host,Name,args[])
- elsif argc == 3
- super(){
- debug "Initilize with 3 args"
- type = args[0].type()
- if ( type.to_s == "String")
- host = Host.getByName(args[0])
- elsif ( type.to_s == "MSG::Host")
- host = args[0]
- else
- raise "first argument of type "+args[0].type().to_s+", but expecting either String or MSG::Host"
- end
- if $DEBUG
- puts host
- end