Added SCOOP support for WSF.
WSF_SERVICE is deeply changed, and addition of WSF_EXECUTION. Todo: code cleaning, removing useless things.
This commit is contained in:
@@ -18,40 +18,36 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_CGI_SERVICE_LAUNCHER
|
||||
WSF_CGI_SERVICE_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
WSF_SERVICE_LAUNCHER
|
||||
WSF_SERVICE_LAUNCHER [G]
|
||||
|
||||
create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch
|
||||
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
do
|
||||
create connector.make (Current)
|
||||
create connector
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
|
||||
launch
|
||||
do
|
||||
if attached connector as conn then
|
||||
conn.launch
|
||||
end
|
||||
connector.launch
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
connector: detachable WGI_CGI_CONNECTOR
|
||||
connector: WGI_CGI_CONNECTOR [G]
|
||||
-- Default service name
|
||||
|
||||
;note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
22
library/server/wsf/connector/httpd-safe.ecf
Normal file
22
library/server/wsf/connector/httpd-safe.ecf
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-12-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-12-0 http://www.eiffel.com/developers/xml/configuration-1-12-0.xsd" name="wsf_httpd" uuid="9BF2D71A-0986-4025-9C97-15B65F07C568" library_target="wsf_httpd">
|
||||
<target name="wsf_httpd">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/\.git$</exclude>
|
||||
<exclude>/\.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="connector_httpd" location="..\..\ewsgi\connectors\httpd\httpd-safe.ecf"/>
|
||||
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||
<library name="error" location="..\..\..\utility\general\error\error-safe.ecf"/>
|
||||
<library name="ewsgi" location="..\..\ewsgi\ewsgi-safe.ecf"/>
|
||||
<library name="http" location="..\..\..\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
<library name="wsf" location="..\wsf-safe.ecf"/>
|
||||
<cluster name="wsf_httpd" location=".\httpd\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
168
library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e
Normal file
168
library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e
Normal file
@@ -0,0 +1,168 @@
|
||||
note
|
||||
description: "[
|
||||
Component to launch the service using the default connector
|
||||
|
||||
Eiffel Web httpd for this class
|
||||
|
||||
|
||||
The httpd default connector support options:
|
||||
port: numeric such as 8099 (or equivalent string as "8099")
|
||||
base: base_url (very specific to standalone server)
|
||||
verbose: to display verbose output, useful for Nino
|
||||
force_single_threaded: use only one thread, useful for Nino
|
||||
|
||||
check WSF_SERVICE_LAUNCHER for more documentation
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_HTTPD_SERVICE_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
WSF_SERVICE_LAUNCHER [G]
|
||||
redefine
|
||||
launchable
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
local
|
||||
conn: like connector
|
||||
do
|
||||
create on_launched_actions
|
||||
create on_stopped_actions
|
||||
|
||||
port_number := 80 --| Default, but quite often, this port is already used ...
|
||||
base_url := ""
|
||||
|
||||
if attached options as opts then
|
||||
if attached {READABLE_STRING_GENERAL} opts.option ("server_name") as l_server_name then
|
||||
server_name := l_server_name.to_string_8
|
||||
end
|
||||
if attached {INTEGER} opts.option ("port") as l_port then
|
||||
port_number := l_port
|
||||
elseif
|
||||
attached {READABLE_STRING_GENERAL} opts.option ("port") as l_port_str and then
|
||||
l_port_str.is_integer
|
||||
then
|
||||
port_number := l_port_str.as_string_8.to_integer
|
||||
end
|
||||
if attached {READABLE_STRING_GENERAL} opts.option ("base") as l_base_str then
|
||||
base_url := l_base_str.as_string_8
|
||||
end
|
||||
if attached {BOOLEAN} opts.option ("force_single_threaded") as l_single_threaded then
|
||||
single_threaded := l_single_threaded
|
||||
elseif attached {READABLE_STRING_GENERAL} opts.option ("force_single_threaded") as l_single_threaded_str then
|
||||
single_threaded := l_single_threaded_str.as_lower.same_string ("true")
|
||||
end
|
||||
if attached {BOOLEAN} opts.option ("verbose") as l_verbose then
|
||||
verbose := l_verbose
|
||||
elseif attached {READABLE_STRING_GENERAL} opts.option ("verbose") as l_verbose_str then
|
||||
verbose := l_verbose_str.as_lower.same_string ("true")
|
||||
end
|
||||
end
|
||||
|
||||
create conn.make
|
||||
connector := conn
|
||||
conn.on_launched_actions.extend (agent on_launched)
|
||||
conn.on_stopped_actions.extend (agent on_stopped)
|
||||
conn.set_base (base_url)
|
||||
|
||||
update_configuration (conn.configuration)
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
|
||||
update_configuration (cfg: separate HTTPD_CONFIGURATION)
|
||||
do
|
||||
if single_threaded then
|
||||
cfg.set_force_single_threaded (True)
|
||||
end
|
||||
cfg.set_is_verbose (verbose)
|
||||
if attached server_name as l_server_name then
|
||||
cfg.set_http_server_name (l_server_name)
|
||||
end
|
||||
-- conn.set_port_number (port_number)
|
||||
cfg.http_server_port := port_number
|
||||
end
|
||||
|
||||
launch
|
||||
-- <Precursor/>
|
||||
-- using `port_number', `base_url', `verbose' and `single_threaded'
|
||||
local
|
||||
conn: like connector
|
||||
do
|
||||
conn := connector
|
||||
conn.set_base (base_url)
|
||||
debug ("nino")
|
||||
if verbose then
|
||||
io.error.put_string ("Launching Nino web server on port " + port_number.out)
|
||||
if attached server_name as l_name then
|
||||
io.error.put_string ("%N http://" + l_name + ":" + port_number.out + "/" + base_url + "%N")
|
||||
else
|
||||
io.error.put_string ("%N http://localhost:" + port_number.out + "/" + base_url + "%N")
|
||||
end
|
||||
end
|
||||
end
|
||||
update_configuration (conn.configuration)
|
||||
conn.launch
|
||||
end
|
||||
|
||||
feature -- Callback
|
||||
|
||||
on_launched_actions: ACTION_SEQUENCE [TUPLE [WGI_CONNECTOR]]
|
||||
-- Actions triggered when launched
|
||||
|
||||
on_stopped_actions: ACTION_SEQUENCE [TUPLE [WGI_CONNECTOR]]
|
||||
-- Actions triggered when stopped
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
on_launched (conn: WGI_CONNECTOR)
|
||||
do
|
||||
on_launched_actions.call ([conn])
|
||||
end
|
||||
|
||||
on_stopped (conn: WGI_CONNECTOR)
|
||||
do
|
||||
on_stopped_actions.call ([conn])
|
||||
end
|
||||
|
||||
port_number: INTEGER
|
||||
|
||||
server_name: detachable READABLE_STRING_8
|
||||
|
||||
base_url: READABLE_STRING_8
|
||||
|
||||
verbose: BOOLEAN
|
||||
|
||||
single_threaded: BOOLEAN
|
||||
|
||||
feature -- Status report
|
||||
|
||||
connector: WGI_HTTPD_CONNECTOR [G]
|
||||
-- Default connector
|
||||
|
||||
launchable: BOOLEAN
|
||||
do
|
||||
Result := Precursor and port_number >= 0
|
||||
end
|
||||
|
||||
;note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -18,40 +18,36 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_LIBFCGI_SERVICE_LAUNCHER
|
||||
WSF_LIBFCGI_SERVICE_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
WSF_SERVICE_LAUNCHER
|
||||
WSF_SERVICE_LAUNCHER [G]
|
||||
|
||||
create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
do
|
||||
create connector.make (Current)
|
||||
create connector
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
|
||||
launch
|
||||
do
|
||||
if attached connector as conn then
|
||||
conn.launch
|
||||
end
|
||||
connector.launch
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
connector: detachable WGI_LIBFCGI_CONNECTOR
|
||||
connector: WGI_LIBFCGI_CONNECTOR [G]
|
||||
-- Default service name
|
||||
|
||||
;note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -17,19 +17,17 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_NINO_SERVICE_LAUNCHER
|
||||
WSF_NINO_SERVICE_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
WSF_SERVICE_LAUNCHER
|
||||
WSF_SERVICE_LAUNCHER [G]
|
||||
redefine
|
||||
launchable
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
@@ -70,9 +68,10 @@ feature {NONE} -- Initialization
|
||||
end
|
||||
end
|
||||
create conn.make (Current)
|
||||
connector := conn
|
||||
|
||||
conn.on_launched_actions.extend (agent on_launched)
|
||||
conn.on_stopped_actions.extend (agent on_stopped)
|
||||
connector := conn
|
||||
conn.set_base (base_url)
|
||||
if single_threaded then
|
||||
conn.configuration.set_force_single_threaded (True)
|
||||
@@ -85,29 +84,30 @@ feature -- Execution
|
||||
launch
|
||||
-- <Precursor/>
|
||||
-- using `port_number', `base_url', `verbose' and `single_threaded'
|
||||
local
|
||||
conn: like connector
|
||||
do
|
||||
if attached connector as conn then
|
||||
conn.set_base (base_url)
|
||||
if single_threaded then
|
||||
conn.configuration.set_force_single_threaded (True)
|
||||
end
|
||||
conn.configuration.set_is_verbose (verbose)
|
||||
debug ("nino")
|
||||
if verbose then
|
||||
io.error.put_string ("Launching Nino web server on port " + port_number.out)
|
||||
if attached server_name as l_name then
|
||||
io.error.put_string ("%N http://" + l_name + ":" + port_number.out + "/" + base_url + "%N")
|
||||
else
|
||||
io.error.put_string ("%N http://localhost:" + port_number.out + "/" + base_url + "%N")
|
||||
end
|
||||
conn := connector
|
||||
conn.set_base (base_url)
|
||||
if single_threaded then
|
||||
conn.configuration.set_force_single_threaded (True)
|
||||
end
|
||||
conn.configuration.set_is_verbose (verbose)
|
||||
debug ("nino")
|
||||
if verbose then
|
||||
io.error.put_string ("Launching Nino web server on port " + port_number.out)
|
||||
if attached server_name as l_name then
|
||||
io.error.put_string ("%N http://" + l_name + ":" + port_number.out + "/" + base_url + "%N")
|
||||
else
|
||||
io.error.put_string ("%N http://localhost:" + port_number.out + "/" + base_url + "%N")
|
||||
end
|
||||
end
|
||||
if attached server_name as l_server_name then
|
||||
conn.configuration.set_http_server_name (l_server_name)
|
||||
end
|
||||
conn.configuration.http_server_port := port_number
|
||||
conn.launch
|
||||
end
|
||||
if attached server_name as l_server_name then
|
||||
conn.configuration.set_http_server_name (l_server_name)
|
||||
end
|
||||
conn.configuration.http_server_port := port_number
|
||||
conn.launch
|
||||
end
|
||||
|
||||
feature -- Callback
|
||||
@@ -142,7 +142,7 @@ feature {NONE} -- Implementation
|
||||
|
||||
feature -- Status report
|
||||
|
||||
connector: detachable WGI_NINO_CONNECTOR
|
||||
connector: WGI_NINO_CONNECTOR [G]
|
||||
-- Default connector
|
||||
|
||||
launchable: BOOLEAN
|
||||
@@ -151,7 +151,7 @@ feature -- Status report
|
||||
end
|
||||
|
||||
;note
|
||||
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
Reference in New Issue
Block a user