indexing description: "API origo node." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class NODE_API inherit O_NODE_CLIENT redefine switches, origo_startup select warn end GOA_FAST_CGI_SERVLET_APP rename make as make_httpd, warn as goa_warn, exceptions as goa_exceptions end GOA_SHARED_SERVICE_REGISTRY export {NONE} all end GOA_XRPC_CONSTANTS export {NONE} all end create make feature {NONE} -- Initialization origo_startup is -- Origo node has ben started. local l_thread: WORKER_THREAD do -- start fastcgi handler in own thread create l_thread.make (agent do create config config.set_server_port (fastcgi_port) config.set_document_root (".") make_httpd ("localhost", fastcgi_port, 10) register_servlets init_xmlrpc run rescue -- on error, trace and restart node_logger.error (exception_trace) initialize_listening retry end) l_thread.launch end feature -- Status is_internal: BOOLEAN is -- Is this an internal API node? once Result := has_option (internal_switch) end feature {NONE} -- Argument handling switches: ?ARRAYED_LIST [!ARGUMENT_SWITCH] is -- Comand line switches. once Result := Precursor Result.extend (create {ARGUMENT_SWITCH}.make (internal_switch, "Internal api node?", True, False)) Result.extend (create {ARGUMENT_NATURAL_SWITCH}.make (port_switch, "API fastcgi port.", False, False, "PORT", "Port to use as fastcgi interface.", False)) end internal_switch: STRING is "internal" port_switch: STRING is "p" feature {NONE} -- Implementation name: STRING is "Origo API" version: STRING is "$Revision$" field_exception: BOOLEAN is False -- Don't let goanna retry on an exception, we restart the goanna server ourselves. fastcgi_port: INTEGER is -- Port to use for fastcgi communication. once Result := option_of_name (port_switch).value.to_integer end peer_description: STRING is "xmlrpc interface to origo services." -- Description of this origo node. config: GOA_SERVLET_CONFIG; -- Configuration for servlets register_servlets is -- Initialise servlets local servlet: GOA_XMLRPC_SERVLET; log_file: STRING do servlet_manager.set_servlet_mapping_prefix ("servlet") servlet_manager.set_config (config) create {GOA_XMLRPC_SERVLET} servlet.init (config) -- we want our goanna log to be in the working dir of the node -- (which is the directory where the other logs are stored) log_file := working_directory + operating_environment.directory_separator.out + node_name + ".log" servlet.set_custom_log_file (log_file) servlet_manager.register_servlet (servlet, "xmlrpc") servlet_manager.register_default_servlet (servlet) end init_xmlrpc is -- Initialise XML RPC calls do registry.register (create {GOA_XRPC_SYSTEM}.make, "system") if is_internal then registry.register (create {INTERNAL_USER_SERVICE}.make (Current), "internal_user") registry.register (create {INTERNAL_COMMIT_SERVICE}.make (Current), "internal_commit") registry.register (create {INTERNAL_WIKI_SERVICE}.make (Current), "internal_wiki") registry.register (create {INTERNAL_COMMENT_SERVICE}.make (Current), "internal_comment") registry.register (create {INTERNAL_BLOG_SERVICE}.make (Current), "internal_blog") registry.register (create {INTERNAL_PROJECT_SERVICE}.make (Current), "internal_project") registry.register (create {INTERNAL_RELEASE_SERVICE}.make (Current), "internal_release") registry.register (create {INTERNAL_ISSUE_SERVICE}.make (Current), "internal_issue") else registry.register (create {AUTHORIZATION_SERVICE}.make (Current), "authorization") registry.register (create {PROJECT_SERVICE}.make (Current), "project") registry.register (create {USER_SERVICE}.make (Current), "user") registry.register (create {WORKITEM_SERVICE}.make (Current), "workitem") registry.register (create {RELEASE_SERVICE}.make (Current), "release") registry.register (create {ISSUE_SERVICE}.make (Current), "issue") registry.register (create {SYSTEM_SERVICE}.make (Current), "origo_system") registry.register (create {COMMUNITY_SERVICE}.make (Current), "community") registry.register (create {WIKI_SERVICE}.make (Current),"wiki") end end end