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

@@ -14,7 +14,7 @@ inherit
initialize
end
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
WSF_ROUTED_URI_TEMPLATE_HELPER
WSF_HANDLER_HELPER

View File

@@ -17,7 +17,7 @@ inherit
WSF_NO_PROXY_POLICY
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
WSF_ROUTED_URI_TEMPLATE_HELPER
SHARED_EXECUTION_ENVIRONMENT

View File

@@ -13,7 +13,7 @@ inherit
requires_proxy
end
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
WSF_ROUTED_URI_TEMPLATE_HELPER
WSF_NO_PROXY_POLICY

View File

@@ -0,0 +1,23 @@
<?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="connector_libfcgi" uuid="59C57E56-3EE6-4EF7-873F-7ED084B0EB22" library_target="connector_libfcgi">
<target name="connector_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="transitional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf"/>
<library name="http" location="..\..\..\..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="libfcgi" location="..\..\..\..\..\libfcgi\libfcgi-safe.ecf"/>
<cluster name="src" location="..\..\..\..\..\ewsgi\connectors\libfcgi\src\" recursive="true">
<file_rule>
<exclude>/wgi_.*_connector.e$</exclude>
</file_rule>
</cluster>
<cluster name="src_v0" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,18 @@
<?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="connector_libfcgi" uuid="59C57E56-3EE6-4EF7-873F-7ED084B0EB22" library_target="connector_libfcgi">
<target name="connector_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="transitional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="ewsgi" location="..\..\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\..\..\network\protocol\http\http.ecf"/>
<library name="libfcgi" location="..\..\..\..\..\libfcgi\libfcgi.ecf"/>
<cluster name="src" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,10 @@
${NOTE_KEYWORD}
copyright: "2011-${YEAR}, 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,118 @@
note
description: "Summary description for {WGI_LIBFCGI_CONNECTOR}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
WGI_LIBFCGI_CONNECTOR
inherit
WGI_CONNECTOR
create
make
feature {NONE} -- Initialization
make (a_service: like service)
do
service := a_service
create fcgi.make
create input.make (fcgi)
create output.make (fcgi)
end
feature -- Access
Name: STRING_8 = "libFCGI"
-- Name of Current connector
Version: STRING_8 = "0.1"
-- Version of Current connector
feature {NONE} -- Access
service: WGI_SERVICE
-- Gateway Service
feature -- Server
launch
local
res: INTEGER
do
from
res := fcgi.fcgi_listen
until
res < 0
loop
process_fcgi_request (fcgi.updated_environ_variables, input, output)
res := fcgi.fcgi_listen
end
end
feature -- Execution
process_fcgi_request (vars: STRING_TABLE [READABLE_STRING_8]; a_input: like input; a_output: like output)
local
req: WGI_REQUEST_FROM_TABLE
res: detachable WGI_RESPONSE_STREAM
rescued: BOOLEAN
do
if not rescued then
a_input.reset
create req.make (vars, a_input, Current)
create res.make (a_output, a_output)
service.execute (req, res)
res.push
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.put_string ("<pre>")
res.put_string (l_trace)
res.put_string ("</pre>")
end
res.push
end
end
end
rescue
if not rescued then
rescued := True
retry
end
end
feature -- Input/Output
input: WGI_LIBFCGI_INPUT_STREAM
-- Input from client (from httpd server via FCGI)
output: WGI_LIBFCGI_OUTPUT_STREAM
-- Output to client (via httpd server/fcgi)
feature {NONE} -- Implementation
fcgi: FCGI
invariant
fcgi_attached: fcgi /= Void
note
copyright: "2011-2013, 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,28 @@
<?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="connector_nino" uuid="F91861FB-4FEA-455F-9570-828D7903DC64" library_target="connector_nino">
<target name="connector_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="transitional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="encoder" location="..\..\..\..\..\..\text\encoder\encoder-safe.ecf"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<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>
<cluster name="src" location="..\..\..\..\..\ewsgi\connectors\nino\src\" recursive="true">
<file_rule>
<exclude>/wgi_.*_handler.e$</exclude>
<exclude>/wgi_.*_connector.e$</exclude>
<exclude>/.*_service.e$</exclude>
</file_rule>
</cluster>
<cluster name="src_v0" location=".\src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,28 @@
<?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="connector_nino" uuid="F91861FB-4FEA-455F-9570-828D7903DC64" library_target="connector_nino">
<target name="connector_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="transitional">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="encoder" location="..\..\..\..\..\..\text\encoder\encoder.ecf"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<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>
<cluster name="src" location="..\..\..\..\..\ewsgi\connectors\nino\src\" recursive="true">
<file_rule>
<exclude>/wgi_.*_handler.e$</exclude>
<exclude>/wgi_.*_connector.e$</exclude>
<exclude>/.*_service.e$</exclude>
</file_rule>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,116 @@
note
description: "Summary description for {NINO_SERVICE}."
date: "$Date$"
revision: "$Revision$"
class
NINO_SERVICE
create
make,
make_custom,
make_with_callback,
make_custom_with_callback
feature {NONE} -- Implementation
make (a_service: WGI_SERVICE)
-- Initialize `Current'.
do
make_custom (a_service, Void)
end
make_custom (a_service: WGI_SERVICE; a_base_url: detachable STRING)
-- Initialize `Current'.
require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
do
create connector.make_with_base (a_service, a_base_url)
end
make_with_callback (a_callback: PROCEDURE [ANY, TUPLE [req: WGI_REQUEST; res: WGI_RESPONSE]])
-- Initialize `Current'.
do
make_custom_with_callback (a_callback, Void)
end
make_custom_with_callback (a_callback: PROCEDURE [ANY, TUPLE [req: WGI_REQUEST; res: WGI_RESPONSE]]; a_base_url: detachable STRING)
-- Initialize `Current'.
require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
local
app: WGI_AGENT_SERVICE
do
create app.make (a_callback)
make_custom (app, a_base_url)
end
feature -- Access
connector: WGI_NINO_CONNECTOR
-- Web server connector
feature -- Status report
launched: BOOLEAN
-- Server launched?
do
Result := connector.launched
end
port: INTEGER
-- Port listened
do
Result := connector.port
end
feature -- Status settings
configuration: HTTP_SERVER_CONFIGURATION
do
Result := connector.configuration
end
force_single_threaded
-- Force single threaded behavior
do
configuration.force_single_threaded := True
end
set_is_verbose (b: BOOLEAN)
-- Set verbose message behavior to `b'
do
configuration.set_is_verbose (b)
end
set_base_url (s: detachable READABLE_STRING_8)
-- Set base_url to `s'
do
connector.set_base (s)
end
feature -- Server
listen (a_port: INTEGER)
do
configuration.http_server_port := a_port
connector.launch
end
shutdown
-- Shutdown the server
do
connector.server.shutdown_server
end
note
copyright: "2011-2014, 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,160 @@
note
description: "Summary description for {WGI_NINO_CONNECTOR}."
date: "$Date$"
revision: "$Revision$"
class
WGI_NINO_CONNECTOR
inherit
WGI_CONNECTOR
create
make,
make_with_base
feature {NONE} -- Initialization
make (a_service: like service)
local
cfg: HTTP_SERVER_CONFIGURATION
do
service := a_service
create cfg.make
create server.make (cfg)
-- Callbacks
create on_launched_actions
create on_stopped_actions
end
make_with_base (a_service: like service; a_base: like base)
require
a_base_starts_with_slash: (a_base /= Void and then not a_base.is_empty) implies a_base.starts_with ("/")
do
make (a_service)
set_base (a_base)
end
feature -- Access
name: STRING_8 = "Nino"
-- Name of Current connector
version: STRING_8 = "0.1"
-- Version of Current connector
feature {NONE} -- Access
service: WGI_SERVICE
-- Gateway Service
feature -- Access
server: HTTP_SERVER
configuration: HTTP_SERVER_CONFIGURATION
do
Result := server.configuration
end
feature -- Access
base: detachable READABLE_STRING_8
-- Root url base
feature -- Status report
launched: BOOLEAN
-- Server launched and listening on `port'
port: INTEGER
-- Listening port.
--| 0: not launched
feature -- Callbacks
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 -- Element change
on_launched (a_port: INTEGER)
-- Server launched
do
launched := True
port := a_port
on_launched_actions.call ([Current])
end
on_stopped
-- Server stopped
do
on_stopped_actions.call ([Current])
launched := False
port := 0
end
feature -- Element change
set_base (b: like base)
require
b_starts_with_slash: (b /= Void and then not b.is_empty) implies b.starts_with ("/")
do
base := b
ensure
valid_base: (attached base as l_base and then not l_base.is_empty) implies l_base.starts_with ("/")
end
feature -- Server
launch
local
l_http_handler : HTTP_HANDLER
do
launched := False
port := 0
create {WGI_NINO_HANDLER} l_http_handler.make_with_callback (server, Current)
if configuration.is_verbose then
if attached base as l_base then
io.error.put_string ("Base=" + l_base + "%N")
end
end
server.setup (l_http_handler)
end
process_request (env: STRING_TABLE [READABLE_STRING_8]; a_headers_text: STRING; a_socket: TCP_STREAM_SOCKET)
local
req: WGI_REQUEST_FROM_TABLE
res: detachable WGI_NINO_RESPONSE_STREAM
retried: BOOLEAN
do
if not retried then
create req.make (env, create {WGI_NINO_INPUT_STREAM}.make (a_socket), Current)
create res.make (create {WGI_NINO_OUTPUT_STREAM}.make (a_socket), create {WGI_NINO_ERROR_STREAM}.make_stderr (a_socket.descriptor.out))
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
service.execute (req, res)
res.push
end
rescue
if not retried then
retried := True
retry
end
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

View File

@@ -0,0 +1,260 @@
note
description : "Objects that ..."
author : "$Author$"
date : "$Date$"
revision : "$Revision$"
class
WGI_NINO_HANDLER
inherit
HTTP_CONNECTION_HANDLER
redefine
on_launched,
on_stopped
end
create
make_with_callback
feature {NONE} -- Initialization
make_with_callback (a_server: like server; a_callback: like callback)
-- Initialize `Current'.
do
base := a_callback.base
make (a_server)
callback := a_callback
end
callback: WGI_NINO_CONNECTOR
feature -- Access
base: detachable READABLE_STRING_8
-- Root url base
feature -- Element change
on_launched (a_port: INTEGER)
do
Precursor (a_port)
callback.on_launched (a_port)
end
on_stopped
do
Precursor
callback.on_stopped
end
feature -- Element change
set_base (a_uri: like base)
-- Set `base' to `a_uri'
do
base := a_uri
end
feature -- Request processing
process_request (a_handler: HTTP_CONNECTION_HANDLER; a_socket: TCP_STREAM_SOCKET)
-- Process request ...
local
env: STRING_TABLE [READABLE_STRING_8]
p: INTEGER
l_request_uri, l_script_name, l_query_string, l_path_info: STRING
l_server_name, l_server_port: detachable STRING
l_headers_map: HASH_TABLE [STRING, STRING]
vn: STRING
e: EXECUTION_ENVIRONMENT
enc: URL_ENCODER
utf: UTF_CONVERTER
do
l_request_uri := a_handler.uri
l_headers_map := a_handler.request_header_map
create e
create enc
if attached e.starting_environment as vars then
create env.make_equal (vars.count)
across
vars as c
loop
env.force (utf.utf_32_string_to_utf_8_string_8 (c.item), utf.utf_32_string_to_utf_8_string_8 (c.key))
end
else
create env.make (0)
end
--| for Any Abc-Def-Ghi add (or replace) the HTTP_ABC_DEF_GHI variable to `env'
from
l_headers_map.start
until
l_headers_map.after
loop
create vn.make_from_string (l_headers_map.key_for_iteration.as_upper)
vn.replace_substring_all ("-", "_")
if
vn.starts_with ("CONTENT_") and then
(vn.same_string_general ({WGI_META_NAMES}.content_type) or vn.same_string_general ({WGI_META_NAMES}.content_length))
then
--| Keep this name
else
vn.prepend ("HTTP_")
end
add_environment_variable (l_headers_map.item_for_iteration, vn, env)
l_headers_map.forth
end
--| Specific cases
p := l_request_uri.index_of ('?', 1)
if p > 0 then
l_script_name := l_request_uri.substring (1, p - 1)
l_query_string := l_request_uri.substring (p + 1, l_request_uri.count)
else
l_script_name := l_request_uri.string
l_query_string := ""
end
if attached l_headers_map.item ("Host") as l_host then
check has_host: env.has ("HTTP_HOST") end
-- set_environment_variable (l_host, "HTTP_HOST", env)
p := l_host.index_of (':', 1)
if p > 0 then
l_server_name := l_host.substring (1, p - 1)
l_server_port := l_host.substring (p+1, l_host.count)
else
l_server_name := l_host
l_server_port := "80" -- Default
end
else
check host_available: False end
end
if attached l_headers_map.item ("Authorization") as l_authorization then
check has_authorization: env.has ("HTTP_AUTHORIZATION") end
-- set_environment_variable (l_authorization, "HTTP_AUTHORIZATION", env)
p := l_authorization.index_of (' ', 1)
if p > 0 then
set_environment_variable (l_authorization.substring (1, p - 1), "AUTH_TYPE", env)
end
end
set_environment_variable ("CGI/1.1", "GATEWAY_INTERFACE", env)
set_environment_variable (l_query_string, "QUERY_STRING", env)
if attached a_handler.remote_info as l_remote_info then
set_environment_variable (l_remote_info.addr, "REMOTE_ADDR", env)
set_environment_variable (l_remote_info.hostname, "REMOTE_HOST", env)
set_environment_variable (l_remote_info.port.out, "REMOTE_PORT", env)
-- set_environment_variable (Void, "REMOTE_IDENT", env)
-- set_environment_variable (Void, "REMOTE_USER", env)
end
set_environment_variable (l_request_uri, "REQUEST_URI", env)
set_environment_variable (a_handler.method, "REQUEST_METHOD", env)
set_environment_variable (l_script_name, "SCRIPT_NAME", env)
set_environment_variable (l_server_name, "SERVER_NAME", env)
set_environment_variable (l_server_port, "SERVER_PORT", env)
set_environment_variable (a_handler.version, "SERVER_PROTOCOL", env)
set_environment_variable ({HTTP_SERVER_CONFIGURATION}.Server_details, "SERVER_SOFTWARE", env)
--| Apply `base' value
if attached base as l_base and then l_request_uri /= Void then
if l_request_uri.starts_with (l_base) then
l_path_info := l_request_uri.substring (l_base.count + 1, l_request_uri.count)
p := l_path_info.index_of ('?', 1)
if p > 0 then
l_path_info.keep_head (p - 1)
end
env.force (l_base, "SCRIPT_NAME")
else
-- This should not happen, this means the `base' is not correctly set.
-- It is better to consider base as empty, rather than having empty PATH_INFO
check valid_base_value: False end
l_path_info := l_request_uri
p := l_request_uri.index_of ('?', 1)
if p > 0 then
l_path_info := l_request_uri.substring (1, p - 1)
else
l_path_info := l_request_uri.string
end
env.force ("", "SCRIPT_NAME")
end
--| In order to have same path value for PATH_INFO on various connectors and servers
--| the multiple slashes must be stripped to single slash.
--| tested with: CGI+apache, libfcgi+apache on Windows and Linux
--|
--| For example: "////abc/def///end////" to "/abc/def/end/" ?
convert_multiple_slashes_to_single (l_path_info)
env.force (enc.decoded_utf_8_string (l_path_info), "PATH_INFO")
end
callback.process_request (env, a_handler.request_header, a_socket)
end
add_environment_variable (a_value: detachable STRING; a_var_name: READABLE_STRING_GENERAL; env: STRING_TABLE [READABLE_STRING_8])
-- Add variable `a_var_name => a_value' to `env'
do
if a_value /= Void then
if env.has_key (a_var_name) and then attached env.found_item as l_existing_value then
--| Check http://www.ietf.org/rfc/rfc3875 4.1.18
check find_proper_rewrite_for_same_header: False end
env.force (l_existing_value + " " + a_value, a_var_name)
else
env.force (a_value, a_var_name)
end
end
end
set_environment_variable (a_value: detachable STRING; a_var_name: READABLE_STRING_GENERAL; env: STRING_TABLE [READABLE_STRING_8])
-- Add variable `a_var_name => a_value' to `env'
do
if a_value /= Void then
env.force (a_value, a_var_name)
end
end
feature {NONE} -- Implementation
convert_multiple_slashes_to_single (s: STRING_8)
-- Replace multiple slashes sequence by a single slash character.
local
i,n: INTEGER
do
from
i := 1
n := s.count
until
i > n
loop
if s[i] = '/' then
-- Remove following slashes '/'.
from
i := i + 1
until
i > n or s[i] /= '/'
loop
s.remove (i)
n := n - 1
end
else
i := i + 1
end
end
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

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="ewsgi" uuid="0A4331F9-4D2B-4474-A9F5-8DBE6655714C" library_target="ewsgi">
<target name="ewsgi">
<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="encoder" location="..\..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="error" location="..\..\..\..\utility\general\error\error-safe.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<cluster name="interface" location="src\" recursive="true"/>
<cluster name="specification_connector" location="..\..\..\ewsgi\specification\connector\" recursive="true"/>
<cluster name="specification_request" location="..\..\..\ewsgi\specification\request\" recursive="true"/>
<cluster name="specification_response" location="..\..\..\ewsgi\specification\response\" recursive="true"/>
<cluster name="specification_service" location="specification\service\" recursive="true"/>
<cluster name="specification_stream" location="..\..\..\ewsgi\specification\stream\" recursive="true"/>
<cluster name="src" location="..\..\..\ewsgi\src\" recursive="true"/>
<cluster name="src_v0" location="src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="ewsgi_v0" uuid="0A4331F9-4D2B-4474-A9F5-8DBE6655714C" library_target="ewsgi_v0">
<target name="ewsgi_v0">
<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="encoder" location="..\..\..\..\text\encoder\encoder.ecf" readonly="false"/>
<library name="error" location="..\..\..\..\utility\general\error\error.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<cluster name="interface" location="src\" recursive="true"/>
<cluster name="specification_connector" location="..\..\..\ewsgi\specification\connector\" recursive="true"/>
<cluster name="specification_request" location="..\..\..\ewsgi\specification\request\" recursive="true"/>
<cluster name="specification_response" location="..\..\..\ewsgi\specification\response\" recursive="true"/>
<cluster name="specification_service" location="specification\service\" recursive="true"/>
<cluster name="specification_stream" location="..\..\..\ewsgi\specification\stream\" recursive="true"/>
<cluster name="src" location="..\..\..\ewsgi\src\" recursive="true"/>
<cluster name="src_v0" location="src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,39 @@
note
description: "[
WGI_SERVICE
]"
specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
deferred class
WGI_SERVICE
feature {WGI_CONNECTOR} -- Execution
execute (req: WGI_REQUEST; res: WGI_RESPONSE)
-- Execute the request
-- See `req.input' for input stream
-- `req.meta_variables' for the CGI meta variable
-- and `res' for output buffer
require
res_status_unset: not res.status_is_set
deferred
ensure
res_status_set: res.status_is_set
end
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,48 @@
note
description: "Summary description for {WGI_AGENT_SERVICE}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WGI_AGENT_SERVICE
inherit
WGI_SERVICE
create
make
feature {NONE} -- Implementation
make (a_callback: like callback)
-- Initialize `Current'.
do
callback := a_callback
end
feature {NONE} -- Implementation
callback: PROCEDURE [ANY, TUPLE [req: WGI_REQUEST; res: WGI_RESPONSE]]
-- Procedure called on `execute'
execute (req: WGI_REQUEST; res: WGI_RESPONSE)
-- Execute the request
do
callback.call ([req, res])
end
invariant
callback_attached: callback /= Void
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,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

View File

@@ -0,0 +1,17 @@
<?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="default_libfcgi" uuid="B853CC3A-D173-4DA4-9832-6D0148C8F01F" library_target="default_libfcgi">
<target name="default_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="wsf" location="..\wsf-safe.ecf"/>
<library name="wsf_libfcgi" location="..\connector\libfcgi-safe.ecf"/>
<cluster name="default_libfcgi" location=".\libfcgi\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,17 @@
<?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="default_libfcgi" uuid="B853CC3A-D173-4DA4-9832-6D0148C8F01F" library_target="default_libfcgi">
<target name="default_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="wsf" location="..\wsf.ecf"/>
<library name="wsf_libfcgi" location="..\connector\libfcgi.ecf"/>
<cluster name="default_libfcgi" location=".\libfcgi\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,24 @@
note
description: "Summary description for {WSF_DEFAULT_RESPONSE_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_DEFAULT_RESPONSE_SERVICE
inherit
WSF_DEFAULT_SERVICE
WSF_RESPONSE_SERVICE
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,22 @@
note
description: "Summary description for {WSF_DEFAULT_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_DEFAULT_SERVICE
inherit
WSF_DEFAULT_SERVICE_I [WSF_DEFAULT_SERVICE_LAUNCHER]
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,30 @@
note
description: "Summary description for {WSF_DEFAULT_SERVICE_LAUNCHER}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_DEFAULT_SERVICE_LAUNCHER
inherit
WSF_LIBFCGI_SERVICE_LAUNCHER
create
make,
make_and_launch,
make_callback,
make_callback_and_launch
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,17 @@
<?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="default_nino" uuid="ACBEDC97-956C-45F5-97E3-65A6D9987625" library_target="default_nino">
<target name="default_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="wsf" location="..\wsf-safe.ecf"/>
<library name="wsf_nino" location="..\connector\nino-safe.ecf"/>
<cluster name="default_nino" location=".\nino\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,17 @@
<?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="default_nino" uuid="ACBEDC97-956C-45F5-97E3-65A6D9987625" library_target="default_nino">
<target name="default_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="wsf" location="..\wsf.ecf"/>
<library name="wsf_nino" location="..\connector\nino.ecf"/>
<cluster name="default_nino" location=".\nino\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,24 @@
note
description: "Summary description for {WSF_DEFAULT_RESPONSE_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_DEFAULT_RESPONSE_SERVICE
inherit
WSF_DEFAULT_SERVICE
WSF_RESPONSE_SERVICE
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,22 @@
note
description: "Summary description for {WSF_DEFAULT_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_DEFAULT_SERVICE
inherit
WSF_DEFAULT_SERVICE_I [WSF_DEFAULT_SERVICE_LAUNCHER]
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

@@ -1,20 +1,24 @@
note
description: "[
This class is the link between WGI_SERVICE and WSF_SERVICE
It makes a WSF_SERVICE callable from the WGI_ world.
Default launcher for WSF_SERVICE based on {WSF_NINO_SERVICE_LAUNCHER}
]"
date: "$Date$"
revision: "$Revision$"
class
WSF_TO_WGI_SERVICE
WSF_DEFAULT_SERVICE_LAUNCHER
inherit
WGI_SERVICE
WSF_NINO_SERVICE_LAUNCHER
create
make,
make_and_launch,
make_callback,
make_callback_and_launch
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
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
@@ -23,4 +27,5 @@ note
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -0,0 +1,287 @@
note
description: "Summary description for {WSF_ROUTED_SKELETON_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_ROUTED_SKELETON_SERVICE
inherit
WSF_ROUTED_SERVICE
redefine
execute
end
WSF_SYSTEM_OPTIONS_ACCESS_POLICY
WSF_PROXY_USE_POLICY
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- If the service is available, and request URI is not too long, dispatch the request
-- and if handler is not found, execute the default procedure `execute_default'.
local
l_sess: WSF_ROUTER_SESSION
do
--| When we reach here, the request has already passed check for 400 (Bad request),
--| which is implemented in WSF_REQUEST.make_from_wgi (when it calls `analyze').
if unavailable then
handle_unavailable (res)
elseif requires_proxy (req) then
handle_use_proxy (req, res)
elseif
maximum_uri_length > 0 and then
req.request_uri.count.to_natural_32 > maximum_uri_length
then
handle_request_uri_too_long (res)
elseif
req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) and then
req.request_uri.same_string ("*")
then
handle_server_options (req, res)
else
create l_sess
router.dispatch (req, res, l_sess)
if not l_sess.dispatched then
execute_default (req, res)
end
end
end
feature -- Measurement
maximum_uri_length: NATURAL
-- Maximum length in characters (or zero for no limit) permitted
-- for {WSF_REQUEST}.request_uri
feature -- Status report
unavailable: BOOLEAN
-- Is service currently unavailable?
unavailablity_message: detachable READABLE_STRING_8
-- Message to be included as text of response body for {HTTP_STATUS_CODE}.service_unavailable
unavailability_duration: NATURAL
-- Delta seconds for service unavailability (0 if not known)
unavailable_until: detachable DATE_TIME
-- Time at which service becomes available again (if known)
feature -- Status setting
set_available
-- Set `unavailable' to `False'.
do
unavailable := False
unavailablity_message := Void
unavailable_until := Void
ensure
available: unavailable = False
unavailablity_message_detached: unavailablity_message = Void
unavailable_until_detached: unavailable_until = Void
end
set_unavailable (a_message: READABLE_STRING_8; a_duration: NATURAL; a_until: detachable DATE_TIME)
-- Set `unavailable' to `True'.
require
a_message_attached: a_message /= Void
a_duration_xor_a_until: a_duration > 0 implies a_until = Void
do
unavailable := True
unavailablity_message := a_message
unavailability_duration := a_duration
ensure
unavailable: unavailable = True
unavailablity_message_aliased: unavailablity_message = a_message
unavailability_duration_set: unavailability_duration = a_duration
unavailable_until_aliased: unavailable_until = a_until
end
set_maximum_uri_length (a_len: NATURAL)
-- Set `maximum_uri_length' to `a_len'.
-- Can pass zero to mean no restrictions.
do
maximum_uri_length := a_len
ensure
maximum_uri_length_set: maximum_uri_length = a_len
end
feature {NONE} -- Implementation
handle_unavailable (res: WSF_RESPONSE)
-- Write "Service unavailable" response to `res'.
require
unavailable: unavailable
res_attached: res /= Void
local
h: HTTP_HEADER
do
create h.make
h.put_content_type_text_plain
check attached unavailablity_message as m then
-- invariant `unavailability_message_attached' plus precondition `unavailable'
h.put_content_length (m.count)
h.put_current_date
res.set_status_code ({HTTP_STATUS_CODE}.service_unavailable)
if unavailability_duration > 0 then
h.put_header_key_value ({HTTP_HEADER_NAMES}.header_retry_after, unavailability_duration.out)
elseif attached unavailable_until as u then
h.put_header_key_value ({HTTP_HEADER_NAMES}.header_retry_after,
h.date_to_rfc1123_http_date_format (u))
end
res.put_header_text (h.string)
res.put_string (m)
end
ensure
response_status_is_set: res.status_is_set
status_is_service_unavailable: res.status_code = {HTTP_STATUS_CODE}.service_unavailable
body_sent: res.message_committed and then res.transfered_content_length > 0
body_content_was_unavailablity_message: True -- doesn't seem to be any way to check
end
handle_request_uri_too_long (res: WSF_RESPONSE)
-- Write "Request URI too long" response into `res'.
require
res_attached: res /= Void
local
h: HTTP_HEADER
m: READABLE_STRING_8
do
create h.make
h.put_content_type_text_plain
h.put_current_date
m := "Maximum permitted length for request URI is " + maximum_uri_length.out + " characters"
h.put_content_length (m.count)
res.set_status_code ({HTTP_STATUS_CODE}.request_uri_too_long)
res.put_header_text (h.string)
res.put_string (m)
ensure
response_status_is_set: res.status_is_set
status_is_request_uri_too_long: res.status_code = {HTTP_STATUS_CODE}.request_uri_too_long
body_sent: res.message_committed and then res.transfered_content_length > 0
end
frozen handle_server_options (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Write response to OPTIONS * into `res'.
require
req_attached: req /= Void
res_attached: res /= Void
method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options)
server_options_requested: req.request_uri.same_string ("*")
do
--| First check if forbidden.
--| (N.B. authentication requires an absoluteURI (RFC3617 page 3), and so cannot be used for OPTIONS *.
--| Otherwise construct an Allow response automatically from the router.
if is_system_options_forbidden (req) then
handle_system_options_forbidden (req, res)
else
handle_system_options (req, res)
end
ensure
response_status_is_set: res.status_is_set
valid_response_code: res.status_code = {HTTP_STATUS_CODE}.forbidden or
res.status_code = {HTTP_STATUS_CODE}.not_found or res.status_code = {HTTP_STATUS_CODE}.ok
header_sent: res.header_committed and res.message_committed
end
frozen handle_system_options_forbidden (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Write a 403 Forbidden or a 404 Not found response into `res'.
require
req_attached: req /= Void
res_attached: res /= Void
method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options)
server_options_requested: req.request_uri.same_string ("*")
local
m: detachable READABLE_STRING_8
h: HTTP_HEADER
do
m := system_options_forbidden_text (req)
if attached {READABLE_STRING_8} m as l_msg then
create h.make
h.put_content_type_text_plain
h.put_current_date
h.put_content_length (l_msg.count)
res.set_status_code ({HTTP_STATUS_CODE}.forbidden)
res.put_header_text (h.string)
res.put_string (l_msg)
else
create h.make
h.put_content_type_text_plain
h.put_current_date
h.put_content_length (0)
res.set_status_code ({HTTP_STATUS_CODE}.not_found)
res.put_header_text (h.string)
end
ensure
response_status_is_set: res.status_is_set
valid_response_code: res.status_code = {HTTP_STATUS_CODE}.forbidden or
res.status_code = {HTTP_STATUS_CODE}.not_found
header_sent: res.header_committed
message_sent: res.message_committed
end
handle_system_options (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Write response to OPTIONS * into `res'.
-- This may be redefined by the user, but normally this will not be necessary.
require
req_attached: req /= Void
res_attached: res /= Void
method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options)
server_options_requested: req.request_uri.same_string ("*")
local
h: HTTP_HEADER
do
create h.make
h.put_content_type_text_plain
h.put_current_date
h.put_allow (router.all_allowed_methods)
h.put_content_length (0)
res.set_status_code ({HTTP_STATUS_CODE}.ok)
res.put_header_text (h.string)
ensure
response_status_is_set: res.status_is_set
response_code_ok: res.status_code = {HTTP_STATUS_CODE}.ok
header_sent: res.header_committed and res.message_committed
empty_body: res.transfered_content_length = 0
end
frozen handle_use_proxy (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Write Use Proxy response `res'.
require
res_attached: res /= Void
req_attached: req /= Void
proxy_required: requires_proxy (req)
local
h: HTTP_HEADER
do
create h.make
h.put_content_type_text_plain
h.put_current_date
h.put_location (proxy_server (req).string)
h.put_content_length (0)
res.put_header_lines (h)
res.set_status_code ({HTTP_STATUS_CODE}.use_proxy)
ensure
response_status_is_set: res.status_is_set
response_code_use_proxy: res.status_code = {HTTP_STATUS_CODE}.use_proxy
end
invariant
unavailability_message_attached: unavailable implies attached unavailablity_message as m and then
m.count > 0
unavailability_duration_xor_unavailable_until: unavailability_duration > 0 implies unavailable_until = Void
;note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, 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,29 @@
note
description: "Summary description for {WSF_FILTERED_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_FILTERED_SERVICE
inherit
WSF_FILTERED
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
filter.execute (req, res)
end
;note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,87 @@
note
description: "Summary description for {WSF_ROUTED_SERVICE}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_ROUTED_SERVICE
inherit
WSF_ROUTED
feature -- Initialization
initialize_router
-- Initialize router
do
create_router
setup_router
end
create_router
-- Create `router'
--| could be redefine to initialize with proper capacity
do
create router.make (10)
ensure
router_created: router /= Void
end
setup_router
-- Setup `router'
require
router_created: router /= Void
deferred
end
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Dispatch the request
-- and if handler is not found, execute the default procedure `execute_default'.
require
req_attached: req /= Void
res_attached: res /= Void
local
sess: WSF_ROUTER_SESSION
do
create sess
router.dispatch (req, res, sess)
if not sess.dispatched then
execute_default (req, res)
end
ensure
response_status_is_set: res.status_is_set
end
execute_default (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Dispatch requests without a matching handler.
require
req_attached: req /= Void
res_attached: res /= Void
local
msg: WSF_DEFAULT_ROUTER_RESPONSE
do
create msg.make_with_router (req, router)
msg.set_documentation_included (True)
res.send (msg)
end
feature -- Access
router: WSF_ROUTER
-- Router used to dispatch the request according to the WSF_REQUEST object
-- and associated request methods
;note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,31 @@
note
description: "Summary description for {WSF_DEFAULT_SERVICE_I}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_DEFAULT_SERVICE_I [G -> WSF_SERVICE_LAUNCHER create make_and_launch end]
inherit
WSF_LAUNCHABLE_SERVICE
feature {NONE} -- Initialization
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
local
l_launcher: G
do
create l_launcher.make_and_launch (a_service, opts)
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,59 @@
note
description: "Summary description for {WSF_LAUNCHABLE_SERVICE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_LAUNCHABLE_SERVICE
inherit
WSF_SERVICE
feature {NONE} -- Initialization
frozen make_and_launch
do
initialize
launch (Current, service_options)
end
initialize
-- Initialize current service
--| Could be redefine to set custom service option(s)
do
end
service_options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
deferred
end
feature -- Default service options
set_service_option (a_name: READABLE_STRING_GENERAL; a_value: detachable ANY)
-- Set options related to WSF_SERVICE_LAUNCHER
local
opts: like service_options
do
opts := service_options
if opts = Void then
create opts.make
service_options := opts
end
opts.set_option (a_name, a_value)
ensure
attached service_options as l_options and then l_options.option (a_name) = a_value
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,41 @@
note
description: "[
Inherit from this class to implement the main entry of your web service
You just need to implement `execute', get data from the request `req'
and return a response message
]"
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_RESPONSE_SERVICE
inherit
WSF_SERVICE
feature -- Response
response (req: WSF_REQUEST): WSF_RESPONSE_MESSAGE
deferred
ensure
Result_attached: Result /= Void
end
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
res.send (response (req))
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,41 @@
note
description: "[
Inherit from this class to implement the main entry of your web service
You just need to implement `execute', get data from the request `req'
and write the response in `res'
]"
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_SERVICE
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute the request
-- See `req.input' for input stream
-- `req.meta_variables' for the CGI meta variable
-- and `res' for output buffer
deferred
end
feature -- Conversion
to_wgi_service: WGI_SERVICE
-- Adapt Current WSF Service to plug into WGI component
do
create {WSF_TO_WGI_SERVICE} Result.make_from_service (Current)
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,132 @@
note
description: "[
Component to launch the service using the default connector
How-to:
s: WSF_SERVICE_LAUNCHER
create s.make_and_launch (service)
`service' can be Current if inherit from WSF_SERVICE
or also `create {WSF_CALLBACK_SERVICE}.make (agent execute)'
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
-- ...
end
You can also provide specific options that might be relevant
only for specific connectors such as
For instance, you can use
create s.make_and_launch_and_options (agent execute, <<["port", 8099]>>)
And if Nino is the default connector it will support:
port: numeric such as 8099 (or equivalent string as "8099")
base: base_url (very specific to standalone server)
force_single_threaded: use only one thread, useful for Nino
verbose: to display verbose output, useful for Nino
]"
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_SERVICE_LAUNCHER
inherit
WSF_TO_WGI_SERVICE
feature {NONE} -- Initialization
frozen make (a_service: like service; a_options: like options)
do
make_from_service (a_service)
options := a_options
initialize
ensure
service_set: service = a_service
options_set: options = a_options
launchable: launchable
end
frozen make_and_launch (a_service: like service; a_options: like options)
do
make (a_service, a_options)
launch
end
frozen make_callback (a_callback: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; a_options: like options)
do
make (create {WSF_CALLBACK_SERVICE}.make (a_callback), a_options)
end
frozen make_callback_and_launch (a_callback: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; a_options: like options)
do
make (create {WSF_CALLBACK_SERVICE}.make (a_callback), a_options)
end
initialize
-- Initialize Current using `options' if attached
-- and build the connector
require
service_set: service /= Void
deferred
ensure
connector_attached: connector /= Void
end
feature -- Status report
launchable: BOOLEAN
-- Is default service launchable?
do
Result := connector /= Void
end
connector: detachable WGI_CONNECTOR
-- Connector associated to current default service
deferred
end
connector_name: READABLE_STRING_8
-- Connector's name associated to current default service
do
if attached connector as conn then
Result := conn.name
else
check
connector_attached: False
end
Result := ""
end
end
feature -- Execution
launch
-- Launch default service
require
launchable: launchable
deferred
end
feature {NONE} -- Implementation
options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
-- Custom options which might be support (or not) by the default service
invariant
connector_attached: connector /= Void
note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, 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,124 @@
note
description: "[
Options used by WSF_SERVICE_LAUNCHER
For instance options supported by Nino as default connector::
port: numeric such as 8099 (or equivalent string as "8099")
base: base_url (very specific to standalone server)
force_single_threaded: use only one thread, useful for Nino
verbose: to display verbose output, useful for Nino
]"
date: "$Date$"
revision: "$Revision$"
class
WSF_SERVICE_LAUNCHER_OPTIONS
inherit
TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL]
redefine
default_create
end
create
default_create,
make,
make_from_array,
make_from_iterable
convert
make_from_array ({ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]]})
feature {NONE} -- Initialization
default_create
do
Precursor
create options.make (0)
end
make
do
default_create
end
make_from_array (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
do
make
append_array_of_options (a_options)
end
make_from_iterable (a_options: TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL])
do
make
append_options (a_options)
end
feature -- Merging
append_array_of_options (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
do
across
a_options as opt
loop
if attached opt.item as o then
set_option (o.name, o.value)
end
end
end
append_options (a_options: TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL])
do
across
a_options as o
loop
set_option (o.key, o.item)
end
end
feature -- Access
option (a_name: READABLE_STRING_GENERAL): detachable ANY
do
Result := options.item (a_name)
end
feature -- Access
new_cursor: TABLE_ITERATION_CURSOR [detachable ANY, READABLE_STRING_GENERAL]
-- Fresh cursor associated with current structure
do
Result := options.new_cursor
end
feature -- Element change
set_option (a_name: READABLE_STRING_GENERAL; a_value: detachable ANY)
do
options.force (a_value, a_name)
end
set_verbose (b: BOOLEAN)
-- Set option "verbose" to `b'
do
set_option ("verbose", b)
end
feature {NONE} -- Implementation
options: STRING_TABLE [detachable ANY]
-- Custom options which might be support (or not) by the default service
invariant
options_attached: options /= Void
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,84 @@
note
description: "[
Options used by WSF_SERVICE_LAUNCHER
Built from ini configuration file
]"
class
WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI
inherit
WSF_SERVICE_LAUNCHER_OPTIONS
create
make_from_file,
make_from_file_and_defaults
feature {NONE} -- Initialization
make_from_file (a_filename: READABLE_STRING_GENERAL)
-- Initialize `Current'.
do
make
import (a_filename)
end
make_from_file_and_defaults (a_filename: READABLE_STRING_GENERAL; dft: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
-- Initialize `Current'.
do
make
if dft /= Void then
append_options (dft)
end
import (a_filename)
end
feature {NONE} -- Implementation
import (a_filename: READABLE_STRING_GENERAL)
-- Import ini file content
local
f: PLAIN_TEXT_FILE
l,v: STRING_8
p: INTEGER
do
create f.make_with_name (a_filename)
if f.exists and f.is_readable then
f.open_read
from
f.read_line
until
f.exhausted
loop
l := f.last_string
l.left_adjust
if not l.is_empty and then l[1] /= '#' then
p := l.index_of ('=', 1)
if p > 1 then
v := l.substring (p + 1, l.count)
l.keep_head (p - 1)
v.left_adjust
v.right_adjust
l.right_adjust
set_option (l.as_lower, v)
end
end
f.read_line
end
f.close
end
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,67 @@
note
description: "[
This class is the link between WGI_SERVICE and WSF_SERVICE
It makes a WSF_SERVICE callable from the WGI_ world.
]"
date: "$Date$"
revision: "$Revision$"
class
WSF_TO_WGI_SERVICE
inherit
WGI_SERVICE
WGI_EXPORTER
create
make_from_service
feature {NONE} -- Make
make_from_service (a_service: like service)
-- Make from WSF_SERVICE `a_service'
do
service := a_service
end
service: WSF_SERVICE
-- Associated WSF_SERVICE
feature {WGI_CONNECTOR} -- Implementation: Execution
execute (req: WGI_REQUEST; res: WGI_RESPONSE)
-- Delegate the WGI processing to the WSF_SERVICE object
-- <Precursor>
local
w_res: detachable WSF_RESPONSE
w_req: detachable WSF_REQUEST
do
create w_res.make_from_wgi (res)
create w_req.make_from_wgi (req)
service.execute (w_req, w_res)
w_req.destroy
rescue
if w_res /= Void then
if not (w_res.status_committed or w_res.header_committed) then
w_res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error)
end
w_res.flush
end
if w_req /= Void then
w_req.destroy
end
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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,37 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf" uuid="FB2987AA-926E-4F5D-A04A-407E0415A3FD" library_target="wsf">
<target name="wsf">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
</option>
<mapping old_name="WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE" new_name="WSF_ROUTED_URI_TEMPLATE_HELPER"/>
<mapping old_name="WSF_URI_HELPER_FOR_ROUTED_SERVICE" new_name="WSF_ROUTED_URI_HELPER"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="conneg" location="..\..\..\..\network\protocol\content_negotiation\conneg-safe.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder-safe.ecf"/>
<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="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf"/>
<library name="uri_template" location="..\..\..\..\text\parser\uri_template\uri_template-safe.ecf"/>
<cluster name="router" location="..\..\..\wsf\router\" recursive="true">
<file_rule>
<exclude>/policy_driven$</exclude>
</file_rule>
</cluster>
<cluster name="router_v0" location="router\" recursive="true"/>
<cluster name="src" location="..\..\..\wsf\src\" recursive="true">
<file_rule>
<exclude>/service$</exclude>
</file_rule>
</cluster>
<cluster name="src_v0" location="src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf_v0" uuid="FB2987AA-926E-4F5D-A04A-407E0415A3FD" library_target="wsf_v0">
<target name="wsf_v0">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="provisional">
</option>
<mapping old_name="WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE" new_name="WSF_ROUTED_URI_TEMPLATE_HELPER"/>
<mapping old_name="WSF_URI_HELPER_FOR_ROUTED_SERVICE" new_name="WSF_ROUTED_URI_HELPER"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="conneg" location="..\..\..\..\network\protocol\content_negotiation\conneg.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder.ecf"/>
<library name="error" location="..\..\..\..\utility\general\error\error.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri.ecf"/>
<library name="uri_template" location="..\..\..\..\text\parser\uri_template\uri_template.ecf"/>
<cluster name="router" location="..\..\..\wsf\router\" recursive="true">
<file_rule>
<exclude>/policy_driven$</exclude>
</file_rule>
</cluster>
<cluster name="router_v0" location="router\" recursive="true"/>
<cluster name="src" location="..\..\..\wsf\src\" recursive="true">
<file_rule>
<exclude>/service$</exclude>
</file_rule>
</cluster>
<cluster name="src_v0" location="src\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,20 @@
<?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_extension" uuid="11055B92-CBEF-4272-8B50-0450BDA154E5" library_target="wsf_extension">
<target name="wsf_extension">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder-safe.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="wsf" location="wsf-safe.ecf"/>
<library name="wsf_router_context" location="wsf_router_context-safe.ecf" readonly="true"/>
<cluster name="extension" location="..\..\..\wsf\extension\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,20 @@
<?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_extension" uuid="11055B92-CBEF-4272-8B50-0450BDA154E5" library_target="wsf_extension">
<target name="wsf_extension">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http.ecf"/>
<library name="wsf" location="wsf.ecf"/>
<library name="wsf_router_context" location="wsf_router_context.ecf" readonly="true"/>
<cluster name="extension" location="..\..\..\wsf\extension\" 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-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf_policy_driven" uuid="3FC00449-5101-461D-94C6-10920C30EBF4" library_target="wsf_policy_driven">
<target name="wsf_policy_driven">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="conneg" location="..\..\..\..\network\protocol\content_negotiation\conneg-safe.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder-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="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf"/>
<library name="wsf" location="wsf-safe.ecf"/>
<cluster name="policy" location="..\..\..\wsf\policy_driven\" 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-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf_policy_driven" uuid="3FC00449-5101-461D-94C6-10920C30EBF4" library_target="wsf_policy_driven">
<target name="wsf_policy_driven">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="conneg" location="..\..\..\..\network\protocol\content_negotiation\conneg.ecf"/>
<library name="encoder" location="..\..\..\..\text\encoder\encoder.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi.ecf"/>
<library name="http" location="..\..\..\..\network\protocol\http\http.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri.ecf"/>
<library name="wsf" location="wsf.ecf"/>
<cluster name="policy" location="..\..\..\wsf\policy_driven\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,16 @@
<?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_router_context" uuid="1A0F9B0E-26CE-4DE0-BE47-C74D1AB2B389" library_target="wsf_router_context">
<target name="wsf_router_context">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="wsf" location="wsf-safe.ecf"/>
<cluster name="router_context" location="..\..\..\wsf\router_context\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,16 @@
<?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_router_context" uuid="1A0F9B0E-26CE-4DE0-BE47-C74D1AB2B389" library_target="wsf_router_context">
<target name="wsf_router_context">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="wsf" location="wsf.ecf"/>
<cluster name="router_context" location="..\..\..\wsf\router_context\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<redirection xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" uuid="C41D0367-9852-4AA7-9E7E-DEA162A4CBB0" location="../../../wsf/wsf_session-safe.ecf">
</redirection>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<redirection xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" uuid="C41D0367-9852-4AA7-9E7E-DEA162A4CBB0" location="../../../wsf/wsf_session.ecf">
</redirection>

View File

@@ -0,0 +1,63 @@
note
description: "Object with a `filter: WSF_FILTER' feature."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_FILTERED
feature {NONE} -- Initialization
initialize_filter
-- Initialize `filter'
do
create_filter
setup_filter
end
create_filter
-- Create `filter'
deferred
ensure
filter_created: filter /= Void
end
setup_filter
-- Setup `filter'
require
filter_created: filter /= Void
deferred
end
append_filters (a_filters: ITERABLE [WSF_FILTER])
-- Append collection `a_filters' of filters to the end of the `filter' chain.
local
f: like filter
l_next_filter: detachable like filter
do
from
f := filter
l_next_filter := f.next
until
l_next_filter = Void
loop
f := l_next_filter
l_next_filter := f.next
end
check f_attached_without_next: f /= Void and then f.next = Void end
across
a_filters as ic
loop
l_next_filter := ic.item
f.set_next (l_next_filter)
f := l_next_filter
end
end
feature -- Access
filter: WSF_FILTER
-- Filter
end

View File

@@ -13,6 +13,8 @@ inherit
initialize
end
WSF_FILTERED
feature {NONE} -- Initialization
initialize
@@ -21,57 +23,6 @@ feature {NONE} -- Initialization
initialize_filter
end
initialize_filter
-- Initialize `filter'
do
create_filter
setup_filter
end
create_filter
-- Create `filter'
deferred
ensure
filter_created: filter /= Void
end
setup_filter
-- Setup `filter'
require
filter_created: filter /= Void
deferred
end
append_filters (a_filters: ITERABLE [WSF_FILTER])
-- Append collection `a_filters' of filters to the end of the `filter' chain.
local
f: like filter
l_next_filter: detachable like filter
do
from
f := filter
l_next_filter := f.next
until
l_next_filter = Void
loop
f := l_next_filter
l_next_filter := f.next
end
check f_attached_without_next: f /= Void and then f.next = Void end
across
a_filters as ic
loop
l_next_filter := ic.item
f.set_next (l_next_filter)
f := l_next_filter
end
end
feature -- Access
filter: WSF_FILTER
-- Filter
feature -- Execution
execute

View File

@@ -1,22 +1,13 @@
note
description: "Facilities inheritance to add URI base routing to a routed execution"
description: "Facilities inheritance to add URI base routing to a routed object."
date: "$Date$"
revision: "$Revision$"
deferred class WSF_URI_HELPER_FOR_ROUTED_EXECUTION
deferred class WSF_ROUTED_URI_HELPER
feature -- Access
router: WSF_ROUTER
-- Router used to dispatch the request according to the WSF_REQUEST object
-- and associated request methods;
-- This should not be implemented by descendants. Instead, you gain an effective
-- version by also inheriting from WSF_ROUTED_EXECUTION, or one of it's descendants.
deferred
ensure
router_not_void: Result /= Void
end
inherit
WSF_ROUTED
feature -- Mapping helper: uri
@@ -47,7 +38,7 @@ feature -- Mapping helper: uri agent
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -1,23 +1,13 @@
note
description: "Facilities inheritance to add URI template-base routing to a routed execution"
author: ""
description: "Facilities inheritance to add URI template-base routing to a routed object."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
WSF_ROUTED_URI_TEMPLATE_HELPER
feature -- Access
router: WSF_ROUTER
-- Router used to dispatch the request according to the WSF_REQUEST object
-- and associated request methods;
-- This should not be implemented by descendants. Instead, you gain an effective
-- version by also inheriting from WSF_ROUTED_SERVICE, or one of it's descendants.
deferred
ensure
router_not_void: Result /= Void
end
inherit
WSF_ROUTED
feature -- Mapping helper: uri template
@@ -60,7 +50,7 @@ feature -- Mapping helper: uri template agent
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -0,0 +1,31 @@
note
description: "Object with a `router' feature, used to dispatch url."
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_ROUTED
feature -- Access
router: WSF_ROUTER
-- Router used to dispatch the request according to the WSF_REQUEST object
-- and associated request methods;
-- This should not be implemented by descendants. Instead, you gain an effective
-- version by also inheriting from WSF_ROUTED_EXECUTION, or one of it's descendants.
deferred
ensure
router_not_void: Result /= Void
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, 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

@@ -12,6 +12,8 @@ inherit
initialize
end
WSF_ROUTED
feature {NONE} -- Initialize
initialize

View File

@@ -23,9 +23,15 @@ feature {NONE} -- Initialization
do
end
feature -- Access
service_options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
-- Optional service options used to configure associated WSF_SERVICE_LAUNCHER.
feature -- Basic operation
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
-- Launch service with optional options `opts'.
deferred
end

View File

@@ -1,5 +1,5 @@
<?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" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
<target name="wsf">
<root all_classes="true"/>
<file_rule>
@@ -9,6 +9,8 @@
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
</option>
<mapping old_name="WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION" new_name="WSF_ROUTED_URI_TEMPLATE_HELPER"/>
<mapping old_name="WSF_URI_HELPER_FOR_ROUTED_EXECUTION" new_name="WSF_ROUTED_URI_HELPER"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="conneg" location="..\..\network\protocol\content_negotiation\conneg-safe.ecf"/>