queuemgr.rb
Path: queuemgr/queuemgr.rb
Modified: Sun Apr 06 11:50:25 MDT 2003
Required files
monitor    optparse    singleton    util/config    util/daemon    util/logging    queuemgr/queuemgrproxy    xmlrpc/server   
Methods
exit_existing    main    start    start_server   
Classes and Modules
Class Named
Class Opts
Included modules
Daemon
Public Instance methods
exit_existing()
# File queuemgr/queuemgr.rb, line 175
def exit_existing() 
  QMgrProxy.new(Config.instance.named["host"], 
		    Config.instance.named["port"].to_i).exit()
end
start_server(vals, args)

Server setup code is here.

# File queuemgr/queuemgr.rb, line 182
def start_server(vals, args)
  port = vals["port"].to_i
  host = vals["host"]
  xs = XMLRPC::Server.new(port, host)
  xs.add_handler(Named::INTERFACE, Named.new)
  xs.serve
end
main(opts, args)

Start execution with main here.

# File queuemgr/queuemgr.rb, line 192
def main(opts, args)
  if args.size > 0 && args.shift == "exit"
    exit_existing
  elsif opts.vals["daemon"] != "yes"
    start_server(opts.vals, args)
  else
    daemon(opts, args) {
      |vals, args| 
      tommy_mode
      start_server(opts.vals, args)
      exit 0
    }
  end
  return 0
end
start(av)

Entry point if called as executable.

# File queuemgr/queuemgr.rb, line 281
def start(av)
  Opts.set_text(USAGE, BANNER)
  opts = Opts.instance
  return main(opts, opts.parse(av))
end