Added abstraction WSF_ROUTED, and WSF_FILTERED.

Added under library/server/obsolete/v0 the previous non concurrent friendly version of EWF/WSF, for backward compatiblity.
Removed WSF_CALLBACK_SERVICE and WSF_TO_WGI_SERVICE which are not need with new EWF.
This commit is contained in:
2015-05-06 19:32:05 +02:00
parent 019393fdb1
commit 8ea443c115
64 changed files with 2741 additions and 90 deletions

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-11-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-11-0 http://www.eiffel.com/developers/xml/configuration-1-11-0.xsd" name="wsf_libfcgi" uuid="00B169F1-2BE2-4986-8B93-825FEB944FFD" library_target="wsf_libfcgi">
<target name="wsf_libfcgi">
<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_libfcgi" location="..\..\..\..\obsolete\v0\ewsgi\connectors\libfcgi\libfcgi-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="..\..\..\..\obsolete\v0\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_libfcgi" location=".\libfcgi\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-11-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-11-0 http://www.eiffel.com/developers/xml/configuration-1-11-0.xsd" name="wsf_libfcgi" uuid="00B169F1-2BE2-4986-8B93-825FEB944FFD" library_target="wsf_libfcgi">
<target name="wsf_libfcgi">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="provisional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector_libfcgi" location="..\..\..\..\obsolete\v0\ewsgi\connectors\libfcgi\libfcgi.ecf"/>
<library name="encoder" location="..\..\..\..\..\text\encoder\encoder.ecf" readonly="false"/>
<library name="error" location="..\..\..\..\..\utility\general\error\error.ecf"/>
<library name="ewsgi" location="..\..\..\..\obsolete\v0\ewsgi\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\..\network\protocol\http\http.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="..\wsf.ecf"/>
<cluster name="wsf_libfcgi" location=".\libfcgi\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,64 @@
note
description: "[
Component to launch the service using the default connector
libFCGI for this class
How-to:
s: WSF_DEFAULT_SERVICE_LAUNCHER
create s.make_and_launch (agent execute)
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
-- ...
end
]"
date: "$Date$"
revision: "$Revision$"
class
WSF_LIBFCGI_SERVICE_LAUNCHER
inherit
WSF_SERVICE_LAUNCHER
create
make,
make_and_launch,
make_callback,
make_callback_and_launch
feature {NONE} -- Initialization
initialize
do
create connector.make (Current)
end
feature -- Execution
launch
do
if attached connector as conn then
conn.launch
end
end
feature -- Status report
connector: detachable WGI_LIBFCGI_CONNECTOR
-- Default service name
;note
copyright: "2011-2012, 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

View File

@@ -0,0 +1,10 @@
${NOTE_KEYWORD}
copyright: "2011-${YEAR}, 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
]"

View File

@@ -0,0 +1,25 @@
<?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_nino" uuid="BACF0220-900B-4409-8CB2-30A09836A650" library_target="wsf_nino">
<target name="wsf_nino">
<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_nino" location="..\..\..\..\obsolete\v0\ewsgi\connectors\nino\nino-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="..\..\..\..\obsolete\v0\ewsgi\ewsgi-safe.ecf"/>
<library name="http" location="..\..\..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="nino" location="..\..\..\..\..\..\contrib\library\network\server\nino\nino-safe.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="wsf" location="..\wsf-safe.ecf"/>
<cluster name="wsf_nino" location=".\nino\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,25 @@
<?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_nino" uuid="BACF0220-900B-4409-8CB2-30A09836A650" library_target="wsf_nino">
<target name="wsf_nino">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="provisional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector_nino" location="..\..\..\..\obsolete\v0\ewsgi\connectors\nino\nino.ecf"/>
<library name="encoder" location="..\..\..\..\..\text\encoder\encoder.ecf" readonly="false"/>
<library name="error" location="..\..\..\..\..\utility\general\error\error.ecf"/>
<library name="ewsgi" location="..\..\..\..\obsolete\v0\ewsgi\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\..\network\protocol\http\http.ecf"/>
<library name="nino" location="..\..\..\..\..\..\contrib\library\network\server\nino\nino.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="..\wsf.ecf"/>
<cluster name="wsf_nino" location=".\nino\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,164 @@
note
description: "[
Component to launch the service using the default connector
Eiffel Web Nino for this class
The Nino 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_NINO_SERVICE_LAUNCHER
inherit
WSF_SERVICE_LAUNCHER
redefine
launchable
end
create
make,
make_and_launch,
make_callback,
make_callback_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 (Current)
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)
end
conn.configuration.set_is_verbose (verbose)
end
feature -- Execution
launch
-- <Precursor/>
-- using `port_number', `base_url', `verbose' and `single_threaded'
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
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
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: detachable WGI_NINO_CONNECTOR
-- Default connector
launchable: BOOLEAN
do
Result := Precursor and port_number >= 0
end
;note
copyright: "2011-2013, 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