Implemented WSF_RESPONSE.put_error (...) and related
Added WSF_RESPONSE.put_character Renamed WGI_OUTPUT_STREAM.put_character_8 as put_character to follow style of put_string (and not put_string_8) Refactored the WSF_DEFAULT_SERVICE_LAUNCHER Added WSF_DEFAULT_SERVICE to be more user friendly Splitted the wsf/default/ libraries to have wsf/connector/... and being able to handle more than one connector in the same application
This commit is contained in:
@@ -14,6 +14,8 @@ inherit
|
|||||||
|
|
||||||
WSF_HANDLER_HELPER
|
WSF_HANDLER_HELPER
|
||||||
|
|
||||||
|
WSF_DEFAULT_SERVICE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
|
|
||||||
@@ -24,9 +26,11 @@ feature {NONE} -- Initialization
|
|||||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||||
do
|
do
|
||||||
initialize_router
|
initialize_router
|
||||||
create s.make_and_launch_with_options (agent execute, <<["port", 9090]>>)
|
set_service_option ("port", 9090)
|
||||||
|
make_and_launch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
create_router
|
create_router
|
||||||
do
|
do
|
||||||
create router.make (2)
|
create router.make (2)
|
||||||
|
|||||||
@@ -6,19 +6,14 @@ note
|
|||||||
class
|
class
|
||||||
APPLICATION
|
APPLICATION
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_DEFAULT_SERVICE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make_and_launch
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make
|
|
||||||
-- Run application.
|
|
||||||
local
|
|
||||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
|
||||||
do
|
|
||||||
create s.make_and_launch (agent execute)
|
|
||||||
end
|
|
||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
do
|
do
|
||||||
-- To send a response we need to setup, the status code and
|
-- To send a response we need to setup, the status code and
|
||||||
|
|||||||
@@ -1,20 +1,48 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="simple" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="simple" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||||
<target name="simple">
|
|
||||||
<root class="APPLICATION" feature="make"/>
|
<target name="common" abstract="true">
|
||||||
|
<file_rule>
|
||||||
|
<exclude>/EIFGENs$</exclude>
|
||||||
|
<exclude>/CVS$</exclude>
|
||||||
|
<exclude>/.svn$</exclude>
|
||||||
|
</file_rule>
|
||||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf"/>
|
|
||||||
<library name="http" location="..\..\library\protocol\http\http-safe.ecf"/>
|
<library name="http" location="..\..\library\protocol\http\http-safe.ecf"/>
|
||||||
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf"/>
|
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf"/>
|
||||||
<cluster name="simple" location=".\" recursive="true">
|
|
||||||
<file_rule>
|
|
||||||
<exclude>/EIFGENs$</exclude>
|
|
||||||
<exclude>/CVS$</exclude>
|
|
||||||
<exclude>/.svn$</exclude>
|
|
||||||
</file_rule>
|
|
||||||
</cluster>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="simple_nino" extends="common">
|
||||||
|
<root class="APPLICATION" feature="make_and_launch"/>
|
||||||
|
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||||
|
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||||
|
</option>
|
||||||
|
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf"/>
|
||||||
|
<cluster name="simple" location=".\" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="simple_cgi" extends="common">
|
||||||
|
<root class="APPLICATION" feature="make_and_launch"/>
|
||||||
|
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||||
|
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||||
|
</option>
|
||||||
|
<library name="default_cgi" location="..\..\library\server\wsf\default\cgi-safe.ecf"/>
|
||||||
|
<cluster name="simple" location=".\" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="simple_libfcgi" extends="common">
|
||||||
|
<root class="APPLICATION" feature="make_and_launch"/>
|
||||||
|
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||||
|
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||||
|
</option>
|
||||||
|
<library name="default_libfcgi" location="..\..\library\server\wsf\default\libfcgi-safe.ecf"/>
|
||||||
|
<cluster name="simple" location=".\" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="simple" extends="simple_nino">
|
||||||
|
</target>
|
||||||
|
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -6,19 +6,14 @@ note
|
|||||||
class
|
class
|
||||||
SERVICE_FILE
|
SERVICE_FILE
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_DEFAULT_SERVICE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make_and_launch
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make
|
|
||||||
-- Run application.
|
|
||||||
local
|
|
||||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
|
||||||
do
|
|
||||||
create s.make_and_launch (agent execute)
|
|
||||||
end
|
|
||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
local
|
local
|
||||||
f: WSF_FILE_RESPONSE
|
f: WSF_FILE_RESPONSE
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="service_file" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="service_file" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||||
<target name="service_file">
|
<target name="service_file">
|
||||||
<root class="SERVICE_FILE" feature="make"/>
|
<root class="SERVICE_FILE" feature="make_and_launch"/>
|
||||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ inherit
|
|||||||
|
|
||||||
WSF_URI_TEMPLATE_ROUTED_SERVICE
|
WSF_URI_TEMPLATE_ROUTED_SERVICE
|
||||||
|
|
||||||
|
WSF_DEFAULT_SERVICE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
|
|
||||||
@@ -19,13 +21,14 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
make
|
make
|
||||||
-- Initialize Current
|
-- Initialize Current
|
||||||
local
|
|
||||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
|
||||||
do
|
do
|
||||||
initialize_router
|
initialize_router
|
||||||
create s.make_and_launch (agent execute)
|
|
||||||
-- Use the following line to use particular port number (as 9090) with Nino connector
|
|
||||||
-- create s.make_and_launch_with_options (agent execute, <<["port", 9090]>>)
|
-- To use particular port number (as 9090) with Nino connector
|
||||||
|
-- Uncomment the following line
|
||||||
|
-- set_service_option ("port", 9090)
|
||||||
|
make_and_launch
|
||||||
end
|
end
|
||||||
|
|
||||||
create_router
|
create_router
|
||||||
@@ -126,7 +129,7 @@ feature -- Execution
|
|||||||
n := n - 1
|
n := n - 1
|
||||||
end
|
end
|
||||||
l_body.append (" <input type=%"submit%" value=%"Upload%"/>%N</form>")
|
l_body.append (" <input type=%"submit%" value=%"Upload%"/>%N</form>")
|
||||||
page.send_to (res)
|
res.send (page)
|
||||||
else
|
else
|
||||||
create l_body.make (255)
|
create l_body.make (255)
|
||||||
l_body.append ("<h1>EWF: Uploaded files</h1>%N")
|
l_body.append ("<h1>EWF: Uploaded files</h1>%N")
|
||||||
@@ -154,7 +157,7 @@ feature -- Execution
|
|||||||
page.set_title ("EWF: uploaded image")
|
page.set_title ("EWF: uploaded image")
|
||||||
page.add_style ("../style.css", "all")
|
page.add_style ("../style.css", "all")
|
||||||
page.set_body (l_body)
|
page.set_body (l_body)
|
||||||
page.send_to (res)
|
res.send (page)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ feature -- Execution
|
|||||||
do
|
do
|
||||||
if not rescued then
|
if not rescued then
|
||||||
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_CGI_INPUT_STREAM}.make, Current)
|
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_CGI_INPUT_STREAM}.make, Current)
|
||||||
create res.make (create {WGI_CGI_OUTPUT_STREAM}.make)
|
create res.make (create {WGI_CGI_OUTPUT_STREAM}.make, create {WGI_CGI_ERROR_STREAM}.make)
|
||||||
service.execute (req, res)
|
service.execute (req, res)
|
||||||
else
|
else
|
||||||
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
|
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for WGI_CGI_ERROR_STREAM."
|
||||||
|
legal: "See notice at end of class."
|
||||||
|
status: "See notice at end of class."
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WGI_CGI_ERROR_STREAM
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WGI_ERROR_STREAM
|
||||||
|
|
||||||
|
CONSOLE
|
||||||
|
rename
|
||||||
|
make as console_make
|
||||||
|
end
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make
|
||||||
|
do
|
||||||
|
make_open_stdout ("stderr")
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
do
|
||||||
|
put_readable_string_8 (a_message)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_readable_string_8 (s: READABLE_STRING_8)
|
||||||
|
-- Write `s' at end of default output.
|
||||||
|
local
|
||||||
|
ext: C_STRING
|
||||||
|
do
|
||||||
|
if s.count > 0 then
|
||||||
|
create ext.make (s)
|
||||||
|
console_ps (file_pointer, ext.managed_data.item, s.count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2011, 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
|
||||||
@@ -20,8 +20,8 @@ feature {NONE} -- Initialization
|
|||||||
do
|
do
|
||||||
service := a_service
|
service := a_service
|
||||||
create fcgi.make
|
create fcgi.make
|
||||||
create {WGI_LIBFCGI_INPUT_STREAM} input.make (fcgi)
|
create input.make (fcgi)
|
||||||
create {WGI_LIBFCGI_OUTPUT_STREAM} output.make (fcgi)
|
create output.make (fcgi)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
@@ -63,7 +63,7 @@ feature -- Execution
|
|||||||
do
|
do
|
||||||
if not rescued then
|
if not rescued then
|
||||||
create req.make (vars, a_input, Current)
|
create req.make (vars, a_input, Current)
|
||||||
create res.make (a_output)
|
create res.make (a_output, a_output)
|
||||||
service.execute (req, res)
|
service.execute (req, res)
|
||||||
else
|
else
|
||||||
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
|
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
|
||||||
@@ -84,10 +84,10 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Input/Output
|
feature -- Input/Output
|
||||||
|
|
||||||
input: WGI_INPUT_STREAM
|
input: WGI_LIBFCGI_INPUT_STREAM
|
||||||
-- Input from client (from httpd server via FCGI)
|
-- Input from client (from httpd server via FCGI)
|
||||||
|
|
||||||
output: WGI_OUTPUT_STREAM
|
output: WGI_LIBFCGI_OUTPUT_STREAM
|
||||||
-- Output to client (via httpd server/fcgi)
|
-- Output to client (via httpd server/fcgi)
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ class
|
|||||||
inherit
|
inherit
|
||||||
WGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
|
|
||||||
|
WGI_ERROR_STREAM
|
||||||
|
|
||||||
HTTP_STATUS_CODE_MESSAGES
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
export
|
export
|
||||||
{NONE} all
|
{NONE} all
|
||||||
@@ -68,6 +70,12 @@ feature -- Basic operation
|
|||||||
fcgi.put_string (s)
|
fcgi.put_string (s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
put_character (c: CHARACTER_8)
|
||||||
|
-- Send `c' to http client
|
||||||
|
do
|
||||||
|
fcgi.put_string (c.out)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Basic operations
|
feature -- Basic operations
|
||||||
|
|
||||||
flush
|
flush
|
||||||
@@ -75,6 +83,13 @@ feature -- Basic operations
|
|||||||
do
|
do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
do
|
||||||
|
fcgi.put_error (a_message)
|
||||||
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
fcgi: FCGI
|
fcgi: FCGI
|
||||||
|
|||||||
@@ -8,17 +8,33 @@ class
|
|||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
make_custom
|
make_custom,
|
||||||
|
make_with_callback,
|
||||||
|
make_custom_with_callback
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
make (a_callback: like {WGI_AGENT_SERVICE}.callback)
|
make (a_service: WGI_SERVICE)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
make_custom (a_callback, Void)
|
make_custom (a_service, Void)
|
||||||
end
|
end
|
||||||
|
|
||||||
make_custom (a_callback: like {WGI_AGENT_SERVICE}.callback; a_base_url: detachable STRING)
|
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: like {WGI_AGENT_SERVICE}.callback)
|
||||||
|
-- Initialize `Current'.
|
||||||
|
do
|
||||||
|
make_custom_with_callback (a_callback, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
make_custom_with_callback (a_callback: like {WGI_AGENT_SERVICE}.callback; a_base_url: detachable STRING)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
require
|
require
|
||||||
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
|
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
|
||||||
@@ -26,7 +42,7 @@ feature {NONE} -- Implementation
|
|||||||
app: WGI_AGENT_SERVICE
|
app: WGI_AGENT_SERVICE
|
||||||
do
|
do
|
||||||
create app.make (a_callback)
|
create app.make (a_callback)
|
||||||
create connector.make_with_base (app, a_base_url)
|
make_custom (app, a_base_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
@@ -88,7 +104,7 @@ feature -- Server
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2011, 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)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ feature -- Server
|
|||||||
res: detachable WGI_NINO_RESPONSE_STREAM
|
res: detachable WGI_NINO_RESPONSE_STREAM
|
||||||
do
|
do
|
||||||
create req.make (env, create {WGI_NINO_INPUT_STREAM}.make (a_socket), Current)
|
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 res.make (create {WGI_NINO_OUTPUT_STREAM}.make (a_socket), Void)
|
||||||
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
|
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
|
||||||
service.execute (req, res)
|
service.execute (req, res)
|
||||||
res.commit
|
res.commit
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ class
|
|||||||
|
|
||||||
inherit
|
inherit
|
||||||
WGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
redefine
|
|
||||||
put_character_8
|
|
||||||
end
|
|
||||||
|
|
||||||
HTTP_STATUS_CODE_MESSAGES
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
export
|
export
|
||||||
@@ -66,7 +63,7 @@ feature -- Output
|
|||||||
target.put_readable_string_8 (s)
|
target.put_readable_string_8 (s)
|
||||||
end
|
end
|
||||||
|
|
||||||
put_character_8 (c: CHARACTER_8)
|
put_character (c: CHARACTER_8)
|
||||||
do
|
do
|
||||||
target.put_character (c)
|
target.put_character (c)
|
||||||
end
|
end
|
||||||
@@ -86,7 +83,7 @@ feature -- Basic operations
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2011, 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)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -14,9 +14,8 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (a_service: like service)
|
make
|
||||||
do
|
do
|
||||||
service := a_service
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
@@ -27,42 +26,14 @@ feature -- Access
|
|||||||
Version: STRING_8 = "0.1"
|
Version: STRING_8 = "0.1"
|
||||||
-- Version of Current connector
|
-- Version of Current connector
|
||||||
|
|
||||||
feature {NONE} -- Access
|
|
||||||
|
|
||||||
service: WGI_SERVICE
|
|
||||||
-- Gateway Service
|
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
launch
|
launch
|
||||||
local
|
|
||||||
req: WGI_REQUEST_FROM_TABLE
|
|
||||||
res: detachable WGI_RESPONSE_STREAM
|
|
||||||
rescued: BOOLEAN
|
|
||||||
do
|
do
|
||||||
if not rescued then
|
|
||||||
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_NULL_INPUT_STREAM}.make, Current)
|
|
||||||
create res.make (create {WGI_NULL_OUTPUT_STREAM}.make)
|
|
||||||
service.execute (req, res)
|
|
||||||
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)
|
|
||||||
end
|
|
||||||
if res.message_writable then
|
|
||||||
res.put_string ("<pre>" + l_trace + "</pre>")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
rescued := True
|
|
||||||
retry
|
|
||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2011, Eiffel Software and others"
|
copyright: "2011-2012, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -96,6 +96,13 @@ feature -- Header output operation
|
|||||||
|
|
||||||
feature -- Output operation
|
feature -- Output operation
|
||||||
|
|
||||||
|
put_character (c: CHARACTER_8)
|
||||||
|
-- Send the character `c'
|
||||||
|
require
|
||||||
|
message_writable: message_writable
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
put_string (s: READABLE_STRING_8)
|
put_string (s: READABLE_STRING_8)
|
||||||
-- Send the string `s'
|
-- Send the string `s'
|
||||||
require
|
require
|
||||||
@@ -115,6 +122,14 @@ feature -- Output operation
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error reporting
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Report error described by `a_message'
|
||||||
|
-- This might be used by the underlying connector
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, 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)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
32
library/server/ewsgi/specification/stream/wgi_error_stream.e
Normal file
32
library/server/ewsgi/specification/stream/wgi_error_stream.e
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
note
|
||||||
|
description : "[
|
||||||
|
Objects that represents the error stream
|
||||||
|
]"
|
||||||
|
specification: "EWSGI/connector 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_ERROR_STREAM
|
||||||
|
|
||||||
|
feature -- Output
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Report error described by `a_message'
|
||||||
|
-- This might be used by the underlying connector
|
||||||
|
deferred
|
||||||
|
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
|
||||||
@@ -37,13 +37,12 @@ feature -- Output
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
put_character_8 (c: CHARACTER_8)
|
put_character (c: CHARACTER_8)
|
||||||
-- Write `c' to output stream.
|
-- Write `c' to output stream.
|
||||||
--| Could be redefined for optimization
|
--| Could be redefined for optimization
|
||||||
require
|
require
|
||||||
is_open_write: is_open_write
|
is_open_write: is_open_write
|
||||||
do
|
deferred
|
||||||
put_string (c.out)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Specific output
|
feature -- Specific output
|
||||||
|
|||||||
@@ -17,9 +17,10 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (a_output: like output)
|
make (a_output: like output; a_error: like error)
|
||||||
do
|
do
|
||||||
output := a_output
|
output := a_output
|
||||||
|
error := a_error
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit
|
feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit
|
||||||
@@ -97,6 +98,12 @@ feature -- Header output operation
|
|||||||
|
|
||||||
feature -- Output operation
|
feature -- Output operation
|
||||||
|
|
||||||
|
put_character (c: CHARACTER_8)
|
||||||
|
-- Send the character `c'
|
||||||
|
do
|
||||||
|
output.put_character (c)
|
||||||
|
end
|
||||||
|
|
||||||
put_string (s: READABLE_STRING_8)
|
put_string (s: READABLE_STRING_8)
|
||||||
-- Send the string `s'
|
-- Send the string `s'
|
||||||
do
|
do
|
||||||
@@ -115,11 +122,25 @@ feature -- Output operation
|
|||||||
output.flush
|
output.flush
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error reporting
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Report error described by `a_message'
|
||||||
|
-- This might be used by the underlying connector
|
||||||
|
do
|
||||||
|
if attached error as err then
|
||||||
|
err.put_error (a_message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation: Access
|
feature {NONE} -- Implementation: Access
|
||||||
|
|
||||||
output: WGI_OUTPUT_STREAM
|
output: WGI_OUTPUT_STREAM
|
||||||
-- Server output channel
|
-- Server output channel
|
||||||
|
|
||||||
|
error: detachable WGI_ERROR_STREAM
|
||||||
|
-- Server output channel
|
||||||
|
|
||||||
;note
|
;note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, 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)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ feature -- FCGI output
|
|||||||
io.put_string (a_str)
|
io.put_string (a_str)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (a_str: READABLE_STRING_8)
|
||||||
|
-- Put `a_str' on the FastCGI stdout.
|
||||||
|
do
|
||||||
|
io.error.put_string (a_str)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- FCGI Input
|
feature -- FCGI Input
|
||||||
|
|
||||||
read_from_stdin (n: INTEGER)
|
read_from_stdin (n: INTEGER)
|
||||||
|
|||||||
@@ -96,6 +96,15 @@ feature -- Output
|
|||||||
"FCGI_fwrite($v, 1, $n, FCGI_stdout);"
|
"FCGI_fwrite($v, 1, $n, FCGI_stdout);"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (v: POINTER; n: INTEGER)
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_fwrite($v, 1, $n, FCGI_stderr);"
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
stdout: POINTER
|
stdout: POINTER
|
||||||
@@ -114,6 +123,14 @@ feature -- Access
|
|||||||
"FCGI_stdin"
|
"FCGI_stdin"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stderr: POINTER
|
||||||
|
-- FCGI_stderr() return pointer on error FCGI_FILE
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_stderr"
|
||||||
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -77,6 +77,18 @@ feature -- FCGI output
|
|||||||
{FCGI_C_API}.put_string (l_c_str.item, l_c_str.count)
|
{FCGI_C_API}.put_string (l_c_str.item, l_c_str.count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Put error message `a_message' on the FastCGI stderr
|
||||||
|
local
|
||||||
|
l_c_str: C_STRING
|
||||||
|
do
|
||||||
|
l_c_str := c_buffer
|
||||||
|
l_c_str.set_string (a_message)
|
||||||
|
fcgi.put_error (l_c_str.item, l_c_str.count)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- FCGI Input
|
feature -- FCGI Input
|
||||||
|
|
||||||
copy_from_stdin (n: INTEGER; tf: FILE)
|
copy_from_stdin (n: INTEGER; tf: FILE)
|
||||||
|
|||||||
@@ -101,6 +101,15 @@ feature -- Output
|
|||||||
i := fwrite (v, 1, n, stdout)
|
i := fwrite (v, 1, n, stdout)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (v: POINTER; n: INTEGER)
|
||||||
|
local
|
||||||
|
i: INTEGER
|
||||||
|
do
|
||||||
|
i := fwrite (v, 1, n, stderr)
|
||||||
|
end
|
||||||
|
|
||||||
feature {NONE} -- Output
|
feature {NONE} -- Output
|
||||||
|
|
||||||
fwrite (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
fwrite (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
||||||
@@ -129,6 +138,15 @@ feature -- Access
|
|||||||
"FCGI_stdin"
|
"FCGI_stdin"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stderr: POINTER
|
||||||
|
-- FCGI_stderr() return pointer on error FCGI_FILE
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_stderr"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -136,6 +136,18 @@ feature -- FCGI output
|
|||||||
fcgi.put_string (l_c_str.item, l_c_str.count)
|
fcgi.put_string (l_c_str.item, l_c_str.count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Put error message `a_message' on the FastCGI stderr
|
||||||
|
local
|
||||||
|
l_c_str: C_STRING
|
||||||
|
do
|
||||||
|
l_c_str := c_buffer
|
||||||
|
l_c_str.set_string (a_message)
|
||||||
|
fcgi.put_error (l_c_str.item, l_c_str.count)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- FCGI input
|
feature -- FCGI input
|
||||||
|
|
||||||
copy_from_stdin (n: INTEGER; f: FILE)
|
copy_from_stdin (n: INTEGER; f: FILE)
|
||||||
|
|||||||
30
library/server/wsf/connector/all-safe.ecf
Normal file
30
library/server/wsf/connector/all-safe.ecf
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="wsf_all" uuid="223E2E7D-AA90-4ADC-93CB-D304E794E3E6" library_target="wsf_all">
|
||||||
|
<target name="wsf_all">
|
||||||
|
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
|
<library name="connector_cgi" location="../../ewsgi/connectors/cgi/cgi-safe.ecf"/>
|
||||||
|
<library name="connector_libfcgi" location="../../ewsgi/connectors/libfcgi/libfcgi-safe.ecf"/>
|
||||||
|
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino-safe.ecf"/>
|
||||||
|
<library name="nino" location="..\..\..\..\contrib\library\server\nino\nino-safe.ecf" readonly="false">
|
||||||
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
</library>
|
||||||
|
|
||||||
|
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_nino" location="./nino" recursive="true"/>
|
||||||
|
<cluster name="wsf_cgi" location="./cgi" recursive="true"/>
|
||||||
|
<cluster name="wsf_libfcgi" location="./libfcgi" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
22
library/server/wsf/connector/cgi-safe.ecf
Normal file
22
library/server/wsf/connector/cgi-safe.ecf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="wsf_cgi" uuid="1B416A7F-D49B-43FC-8308-F14AA9531AF8" library_target="wsf_cgi">
|
||||||
|
<target name="wsf_cgi">
|
||||||
|
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
|
<library name="connector_cgi" location="../../ewsgi/connectors/cgi/cgi-safe.ecf"/>
|
||||||
|
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_cgi" location="./cgi" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
22
library/server/wsf/connector/cgi.ecf
Normal file
22
library/server/wsf/connector/cgi.ecf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="wsf_cgi" uuid="1B416A7F-D49B-43FC-8308-F14AA9531AF8" library_target="wsf_cgi">
|
||||||
|
<target name="wsf_cgi">
|
||||||
|
<root all_classes="true"/>
|
||||||
|
<file_rule>
|
||||||
|
<exclude>/EIFGENs$</exclude>
|
||||||
|
<exclude>/\.git$</exclude>
|
||||||
|
<exclude>/\.svn$</exclude>
|
||||||
|
</file_rule>
|
||||||
|
<option warning="true" full_class_checking="true" syntax="provisional">
|
||||||
|
</option>
|
||||||
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
|
<library name="connector_cgi" location="../../ewsgi/connectors/cgi/cgi.ecf"/>
|
||||||
|
<library name="error" location="..\..\..\error\error.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_cgi" location="./cgi" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
64
library/server/wsf/connector/cgi/wsf_cgi_service_launcher.e
Normal file
64
library/server/wsf/connector/cgi/wsf_cgi_service_launcher.e
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
note
|
||||||
|
description: "[
|
||||||
|
Component to launch the service using the default connector
|
||||||
|
|
||||||
|
CGI for this class
|
||||||
|
|
||||||
|
How-to:
|
||||||
|
|
||||||
|
s: WSF_SERVICE_CGI_LAUNCHER
|
||||||
|
create s.make_and_launch (agent execute)
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
do
|
||||||
|
-- ...
|
||||||
|
end
|
||||||
|
]"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_CGI_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_CGI_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
|
||||||
22
library/server/wsf/connector/libfcgi-safe.ecf
Normal file
22
library/server/wsf/connector/libfcgi-safe.ecf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
|
<library name="connector_libfcgi" location="../../ewsgi/connectors/libfcgi/libfcgi-safe.ecf"/>
|
||||||
|
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_libfcgi" location="./libfcgi" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
22
library/server/wsf/connector/libfcgi.ecf
Normal file
22
library/server/wsf/connector/libfcgi.ecf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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" syntax="provisional">
|
||||||
|
</option>
|
||||||
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
|
<library name="connector_libfcgi" location="../../ewsgi/connectors/libfcgi/libfcgi.ecf"/>
|
||||||
|
<library name="error" location="..\..\..\error\error.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_libfcgi" location="./libfcgi" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
@@ -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
|
||||||
10
library/server/wsf/connector/license.lic
Normal file
10
library/server/wsf/connector/license.lic
Normal 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
|
||||||
|
]"
|
||||||
26
library/server/wsf/connector/nino-safe.ecf
Normal file
26
library/server/wsf/connector/nino-safe.ecf
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
|
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino-safe.ecf"/>
|
||||||
|
<library name="nino" location="..\..\..\..\contrib\library\server\nino\nino-safe.ecf" readonly="false">
|
||||||
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
</library>
|
||||||
|
|
||||||
|
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_nino" location="./nino" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
26
library/server/wsf/connector/nino.ecf
Normal file
26
library/server/wsf/connector/nino.ecf
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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" syntax="provisional">
|
||||||
|
</option>
|
||||||
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
|
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
||||||
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
|
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino.ecf"/>
|
||||||
|
<library name="nino" location="..\..\..\..\contrib\library\server\nino\nino.ecf" readonly="false">
|
||||||
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
</library>
|
||||||
|
|
||||||
|
<library name="error" location="..\..\..\error\error.ecf"/>
|
||||||
|
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
||||||
|
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
|
<cluster name="wsf_nino" location="./nino" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
128
library/server/wsf/connector/nino/wsf_nino_service_launcher.e
Normal file
128
library/server/wsf/connector/nino/wsf_nino_service_launcher.e
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
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
|
||||||
|
do
|
||||||
|
port_number := 80 --| Default, but quite often, this port is already used ...
|
||||||
|
base_url := ""
|
||||||
|
|
||||||
|
if attached options as opts then
|
||||||
|
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 connector.make (Current)
|
||||||
|
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)
|
||||||
|
end
|
||||||
|
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
|
||||||
|
print ("Example: start a Nino web server on port " + port_number.out +
|
||||||
|
", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/" + base_url + "%N")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
conn.configuration.http_server_port := port_number
|
||||||
|
conn.launch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
|
port_number: INTEGER
|
||||||
|
|
||||||
|
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-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
|
||||||
@@ -7,16 +7,9 @@
|
|||||||
<exclude>/\.git$</exclude>
|
<exclude>/\.git$</exclude>
|
||||||
<exclude>/\.svn$</exclude>
|
<exclude>/\.svn$</exclude>
|
||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf-safe.ecf"/>
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
<library name="connector_cgi" location="../../ewsgi/connectors/cgi/cgi-safe.ecf"/>
|
<library name="wsf_cgi" location="../connector/cgi-safe.ecf"/>
|
||||||
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_cgi" location="./cgi" recursive="true"/>
|
<cluster name="default_cgi" location="./cgi" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -9,14 +9,8 @@
|
|||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" syntax="provisional">
|
<option warning="true" full_class_checking="true" syntax="provisional">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf.ecf"/>
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
<library name="connector_cgi" location="../../ewsgi/connectors/cgi/cgi.ecf"/>
|
<library name="wsf_cgi" location="../connector/cgi.ecf"/>
|
||||||
<library name="error" location="..\..\..\error\error.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_cgi" location="./cgi" recursive="true"/>
|
<cluster name="default_cgi" location="./cgi" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
22
library/server/wsf/default/cgi/wsf_default_service.e
Normal file
22
library/server/wsf/default/cgi/wsf_default_service.e
Normal 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
|
||||||
@@ -1,19 +1,6 @@
|
|||||||
note
|
note
|
||||||
description: "[
|
description: "Summary description for {WSF_DEFAULT_SERVICE_LAUNCHER}."
|
||||||
Component to launch the service using the default connector
|
author: ""
|
||||||
|
|
||||||
CGI 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$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
@@ -21,36 +8,17 @@ class
|
|||||||
WSF_DEFAULT_SERVICE_LAUNCHER
|
WSF_DEFAULT_SERVICE_LAUNCHER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_DEFAULT_SERVICE_LAUNCHER_I
|
WSF_CGI_SERVICE_LAUNCHER
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
make_and_launch,
|
make_and_launch,
|
||||||
make_and_launch_with_options
|
make_callback,
|
||||||
|
make_callback_and_launch,
|
||||||
|
make_and_launch_with_options -- obsolete
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
note
|
||||||
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
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_CGI_CONNECTOR
|
|
||||||
-- Default service name
|
|
||||||
|
|
||||||
;note
|
|
||||||
copyright: "2011-2011, Eiffel Software and others"
|
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
@@ -59,4 +27,5 @@ feature -- Status report
|
|||||||
Website http://www.eiffel.com
|
Website http://www.eiffel.com
|
||||||
Customer support http://support.eiffel.com
|
Customer support http://support.eiffel.com
|
||||||
]"
|
]"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,16 +7,9 @@
|
|||||||
<exclude>/\.git$</exclude>
|
<exclude>/\.git$</exclude>
|
||||||
<exclude>/\.svn$</exclude>
|
<exclude>/\.svn$</exclude>
|
||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf-safe.ecf"/>
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
<library name="connector_libfcgi" location="../../ewsgi/connectors/libfcgi/libfcgi-safe.ecf"/>
|
<library name="wsf_libfcgi" location="../connector/libfcgi-safe.ecf"/>
|
||||||
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_libfcgi" location="./libfcgi" recursive="true"/>
|
<cluster name="default_libfcgi" location="./libfcgi" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -7,16 +7,9 @@
|
|||||||
<exclude>/\.git$</exclude>
|
<exclude>/\.git$</exclude>
|
||||||
<exclude>/\.svn$</exclude>
|
<exclude>/\.svn$</exclude>
|
||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" syntax="provisional">
|
<option warning="true" full_class_checking="true" syntax="provisional"/>
|
||||||
</option>
|
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf.ecf"/>
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
<library name="connector_libfcgi" location="../../ewsgi/connectors/libfcgi/libfcgi.ecf"/>
|
<library name="wsf_libfcgi" location="../connector/libfcgi.ecf"/>
|
||||||
<library name="error" location="..\..\..\error\error.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_libfcgi" location="./libfcgi" recursive="true"/>
|
<cluster name="default_libfcgi" location="./libfcgi" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
22
library/server/wsf/default/libfcgi/wsf_default_service.e
Normal file
22
library/server/wsf/default/libfcgi/wsf_default_service.e
Normal 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
|
||||||
@@ -1,19 +1,6 @@
|
|||||||
note
|
note
|
||||||
description: "[
|
description: "Summary description for {WSF_DEFAULT_SERVICE_LAUNCHER}."
|
||||||
Component to launch the service using the default connector
|
author: ""
|
||||||
|
|
||||||
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$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
@@ -21,36 +8,17 @@ class
|
|||||||
WSF_DEFAULT_SERVICE_LAUNCHER
|
WSF_DEFAULT_SERVICE_LAUNCHER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_DEFAULT_SERVICE_LAUNCHER_I
|
WSF_LIBFCGI_SERVICE_LAUNCHER
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
make_and_launch,
|
make_and_launch,
|
||||||
make_and_launch_with_options
|
make_callback,
|
||||||
|
make_callback_and_launch,
|
||||||
|
make_and_launch_with_options -- obsolete
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
note
|
||||||
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
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-2011, Eiffel Software and others"
|
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
@@ -59,4 +27,5 @@ feature -- Status report
|
|||||||
Website http://www.eiffel.com
|
Website http://www.eiffel.com
|
||||||
Customer support http://support.eiffel.com
|
Customer support http://support.eiffel.com
|
||||||
]"
|
]"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
10
library/server/wsf/default/license.lic
Normal file
10
library/server/wsf/default/license.lic
Normal 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
|
||||||
|
]"
|
||||||
@@ -7,20 +7,9 @@
|
|||||||
<exclude>/\.git$</exclude>
|
<exclude>/\.git$</exclude>
|
||||||
<exclude>/\.svn$</exclude>
|
<exclude>/\.svn$</exclude>
|
||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf-safe.ecf"/>
|
<library name="wsf" location="../wsf-safe.ecf"/>
|
||||||
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino-safe.ecf"/>
|
<library name="wsf_nino" location="../connector/nino-safe.ecf"/>
|
||||||
<library name="nino" location="..\..\..\..\contrib\library\server\nino\nino-safe.ecf" readonly="false">
|
|
||||||
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
|
||||||
</library>
|
|
||||||
|
|
||||||
<library name="error" location="..\..\..\error\error-safe.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_nino" location="./nino" recursive="true"/>
|
<cluster name="default_nino" location="./nino" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -7,20 +7,9 @@
|
|||||||
<exclude>/\.git$</exclude>
|
<exclude>/\.git$</exclude>
|
||||||
<exclude>/\.svn$</exclude>
|
<exclude>/\.svn$</exclude>
|
||||||
</file_rule>
|
</file_rule>
|
||||||
<option warning="true" full_class_checking="true" syntax="provisional">
|
<option warning="true" full_class_checking="true" syntax="provisional"/>
|
||||||
</option>
|
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
|
||||||
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
|
||||||
<library name="wsf" location="../wsf.ecf"/>
|
<library name="wsf" location="../wsf.ecf"/>
|
||||||
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino.ecf"/>
|
<library name="wsf_nino" location="../connector/nino.ecf"/>
|
||||||
<library name="nino" location="..\..\..\..\contrib\library\server\nino\nino.ecf" readonly="false">
|
|
||||||
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
|
||||||
</library>
|
|
||||||
|
|
||||||
<library name="error" location="..\..\..\error\error.ecf"/>
|
|
||||||
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
|
||||||
<cluster name="default_nino" location="./nino" recursive="true"/>
|
<cluster name="default_nino" location="./nino" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
22
library/server/wsf/default/nino/wsf_default_service.e
Normal file
22
library/server/wsf/default/nino/wsf_default_service.e
Normal 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
|
||||||
@@ -1,17 +1,6 @@
|
|||||||
note
|
note
|
||||||
description: "[
|
description: "[
|
||||||
Component to launch the service using the default connector
|
Default launcher for WSF_SERVICE based on {WSF_NINO_SERVICE_LAUNCHER}
|
||||||
|
|
||||||
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_DEFAULT_SERVICE_LAUNCHER_I for more documentation
|
|
||||||
]"
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
@@ -20,114 +9,17 @@ class
|
|||||||
WSF_DEFAULT_SERVICE_LAUNCHER
|
WSF_DEFAULT_SERVICE_LAUNCHER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_DEFAULT_SERVICE_LAUNCHER_I
|
WSF_NINO_SERVICE_LAUNCHER
|
||||||
redefine
|
|
||||||
launchable
|
|
||||||
end
|
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
make_and_launch,
|
make_and_launch,
|
||||||
make_and_launch_with_options
|
make_callback,
|
||||||
|
make_callback_and_launch,
|
||||||
|
make_and_launch_with_options -- obsolete
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
note
|
||||||
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
initialize
|
|
||||||
local
|
|
||||||
l_name: detachable READABLE_STRING_GENERAL
|
|
||||||
do
|
|
||||||
port_number := 80 --| Default, but quite often, this port is already used ...
|
|
||||||
base_url := ""
|
|
||||||
if attached options as opts then
|
|
||||||
across
|
|
||||||
opts as opt
|
|
||||||
loop
|
|
||||||
if attached opt.item as l_opt_item then
|
|
||||||
l_name := l_opt_item.name
|
|
||||||
if l_name.same_string ("port") then
|
|
||||||
if attached {INTEGER} l_opt_item.value as l_port then
|
|
||||||
port_number := l_port
|
|
||||||
elseif
|
|
||||||
attached {READABLE_STRING_GENERAL} l_opt_item.value as l_port_str and then
|
|
||||||
l_port_str.is_integer
|
|
||||||
then
|
|
||||||
port_number := l_port_str.as_string_8.to_integer
|
|
||||||
end
|
|
||||||
elseif l_name.same_string ("base") then
|
|
||||||
if attached {READABLE_STRING_GENERAL} l_opt_item.value as l_base_str then
|
|
||||||
base_url := l_base_str.as_string_8
|
|
||||||
end
|
|
||||||
elseif l_name.same_string ("force_single_threaded") then
|
|
||||||
if attached {BOOLEAN} l_opt_item.value as l_single_threaded then
|
|
||||||
single_threaded := l_single_threaded
|
|
||||||
elseif attached {READABLE_STRING_GENERAL} l_opt_item.value as l_single_threaded_str then
|
|
||||||
single_threaded := l_single_threaded_str.as_lower.same_string ("true")
|
|
||||||
end
|
|
||||||
elseif l_name.same_string ("verbose") then
|
|
||||||
if attached {BOOLEAN} l_opt_item.value as l_verbose then
|
|
||||||
verbose := l_verbose
|
|
||||||
elseif attached {READABLE_STRING_GENERAL} l_opt_item.value as l_verbose_str then
|
|
||||||
verbose := l_verbose_str.as_lower.same_string ("true")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
create connector.make (Current)
|
|
||||||
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)
|
|
||||||
end
|
|
||||||
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
|
|
||||||
print ("Example: start a Nino web server on port " + port_number.out +
|
|
||||||
", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/" + base_url + "%N")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
conn.configuration.http_server_port := port_number
|
|
||||||
conn.launch
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
|
||||||
|
|
||||||
port_number: INTEGER
|
|
||||||
|
|
||||||
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-2011, Eiffel Software and others"
|
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
@@ -136,4 +28,5 @@ feature -- Status report
|
|||||||
Website http://www.eiffel.com
|
Website http://www.eiffel.com
|
||||||
Customer support http://support.eiffel.com
|
Customer support http://support.eiffel.com
|
||||||
]"
|
]"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for WSF_AGENT_HANDLER."
|
description: "Summary description for WSF_AGENT_HANDLER."
|
||||||
author: ""
|
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ deferred class
|
|||||||
inherit
|
inherit
|
||||||
WSF_HANDLER [C]
|
WSF_HANDLER [C]
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Response
|
||||||
|
|
||||||
response (ctx: C; req: WSF_REQUEST): WSF_RESPONSE_MESSAGE
|
response (ctx: C; req: WSF_REQUEST): WSF_RESPONSE_MESSAGE
|
||||||
require
|
require
|
||||||
@@ -27,7 +27,7 @@ feature -- Execution
|
|||||||
Result_attached: Result /= Void
|
Result_attached: Result /= Void
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Implementation
|
feature -- Execution
|
||||||
|
|
||||||
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- Execute request handler
|
-- Execute request handler
|
||||||
|
|||||||
52
library/server/wsf/src/service/wsf_callback_service.e
Normal file
52
library/server/wsf/src/service/wsf_callback_service.e
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
note
|
||||||
|
description: "[
|
||||||
|
Create this service with a callback to implement {WSF_SERVICE}.execute (req, res)
|
||||||
|
]"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_CALLBACK_SERVICE
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_SERVICE
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
convert
|
||||||
|
make ({PROCEDURE [ANY, TUPLE [WSF_REQUEST, WSF_RESPONSE]]})
|
||||||
|
|
||||||
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
|
make (a_callback: like callback)
|
||||||
|
-- Initialize `Current'.
|
||||||
|
do
|
||||||
|
callback := a_callback
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
|
callback: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]
|
||||||
|
-- Procedure called on `execute'
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_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
|
||||||
50
library/server/wsf/src/service/wsf_default_service_i.e
Normal file
50
library/server/wsf/src/service/wsf_default_service_i.e
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
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_SERVICE
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make_and_launch
|
||||||
|
local
|
||||||
|
l_launcher: G
|
||||||
|
do
|
||||||
|
create l_launcher.make_and_launch (Current, service_options)
|
||||||
|
end
|
||||||
|
|
||||||
|
service_options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
|
||||||
|
|
||||||
|
feature -- Default service options
|
||||||
|
|
||||||
|
set_service_option (a_name: READABLE_STRING_GENERAL; a_value: detachable ANY)
|
||||||
|
-- Set options related to WSF_DEFAULT_SERVICE
|
||||||
|
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-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
|
||||||
41
library/server/wsf/src/service/wsf_response_service.e
Normal file
41
library/server/wsf/src/service/wsf_response_service.e
Normal 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, 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
|
||||||
@@ -10,11 +10,11 @@ note
|
|||||||
deferred class
|
deferred class
|
||||||
WSF_SERVICE
|
WSF_SERVICE
|
||||||
|
|
||||||
inherit
|
--inherit
|
||||||
WGI_SERVICE
|
-- WGI_SERVICE
|
||||||
rename
|
-- rename
|
||||||
execute as wgi_execute
|
-- execute as wgi_execute
|
||||||
end
|
-- end
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
@@ -26,25 +26,25 @@ feature -- Execution
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {WGI_CONNECTOR} -- WGI Execution
|
--feature {WGI_CONNECTOR} -- WGI Execution
|
||||||
|
|
||||||
wgi_execute (req: WGI_REQUEST; res: WGI_RESPONSE)
|
-- wgi_execute (req: WGI_REQUEST; res: WGI_RESPONSE)
|
||||||
local
|
-- local
|
||||||
w_res: detachable WSF_RESPONSE
|
-- w_res: detachable WSF_RESPONSE
|
||||||
w_req: detachable WSF_REQUEST
|
-- w_req: detachable WSF_REQUEST
|
||||||
do
|
-- do
|
||||||
create w_res.make_from_wgi (res)
|
-- create w_res.make_from_wgi (res)
|
||||||
create w_req.make_from_wgi (req)
|
-- create w_req.make_from_wgi (req)
|
||||||
execute (w_req, w_res)
|
-- execute (w_req, w_res)
|
||||||
w_req.destroy
|
-- w_req.destroy
|
||||||
rescue
|
-- rescue
|
||||||
if w_res /= Void then
|
-- if w_res /= Void then
|
||||||
w_res.flush
|
-- w_res.flush
|
||||||
end
|
-- end
|
||||||
if w_req /= Void then
|
-- if w_req /= Void then
|
||||||
w_req.destroy
|
-- w_req.destroy
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
@@ -4,8 +4,11 @@ note
|
|||||||
|
|
||||||
How-to:
|
How-to:
|
||||||
|
|
||||||
s: WSF_DEFAULT_SERVICE_LAUNCHER
|
s: WSF_SERVICE_LAUNCHER
|
||||||
create s.make_and_launch (agent execute)
|
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)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
do
|
do
|
||||||
@@ -29,43 +32,54 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
WSF_DEFAULT_SERVICE_LAUNCHER_I
|
WSF_SERVICE_LAUNCHER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_SERVICE
|
WSF_TO_WGI_SERVICE
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
frozen make (a_action: like action; a_options: like options)
|
frozen make (a_service: like service; a_options: like options)
|
||||||
do
|
do
|
||||||
action := a_action
|
make_from_service (a_service)
|
||||||
options := a_options
|
options := a_options
|
||||||
initialize
|
initialize
|
||||||
ensure
|
ensure
|
||||||
action_set: action = a_action
|
service_set: service = a_service
|
||||||
options_set: options = a_options
|
options_set: options = a_options
|
||||||
launchable: launchable
|
launchable: launchable
|
||||||
end
|
end
|
||||||
|
|
||||||
frozen make_and_launch (a_action: like action)
|
frozen make_and_launch (a_service: like service; a_options: like options)
|
||||||
do
|
|
||||||
make (a_action, Void)
|
|
||||||
launch
|
|
||||||
end
|
|
||||||
|
|
||||||
frozen make_and_launch_with_options (a_action: like action; a_options: attached like options)
|
|
||||||
require
|
require
|
||||||
a_options_attached: a_options /= Void
|
a_options_attached: a_options /= Void
|
||||||
do
|
do
|
||||||
make (a_action, a_options)
|
make (a_service, a_options)
|
||||||
launch
|
launch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
frozen make_callback (a_callback: like {WSF_CALLBACK_SERVICE}.callback; a_options: like options)
|
||||||
|
do
|
||||||
|
make (create {WSF_CALLBACK_SERVICE}.make (a_callback), a_options)
|
||||||
|
end
|
||||||
|
|
||||||
|
frozen make_callback_and_launch (a_callback: like {WSF_CALLBACK_SERVICE}.callback; a_options: like options)
|
||||||
|
do
|
||||||
|
make (create {WSF_CALLBACK_SERVICE}.make (a_callback), a_options)
|
||||||
|
end
|
||||||
|
|
||||||
|
frozen make_and_launch_with_options (a_callback: like {WSF_CALLBACK_SERVICE}.callback; a_options: like options)
|
||||||
|
obsolete
|
||||||
|
"[2012-Mars-20] Use make_callback_and_launch (a_callback, a_options)"
|
||||||
|
do
|
||||||
|
make_callback_and_launch (a_callback, a_options)
|
||||||
|
end
|
||||||
|
|
||||||
initialize
|
initialize
|
||||||
-- Initialize Current using `options' if attached
|
-- Initialize Current using `options' if attached
|
||||||
-- and build the connector
|
-- and build the connector
|
||||||
require
|
require
|
||||||
action_set: action /= Void
|
service_set: service /= Void
|
||||||
deferred
|
deferred
|
||||||
ensure
|
ensure
|
||||||
connector_attached: connector /= Void
|
connector_attached: connector /= Void
|
||||||
@@ -108,20 +122,9 @@ feature -- Execution
|
|||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
options: detachable ARRAY [detachable TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]]
|
options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
|
||||||
-- Custom options which might be support (or not) by the default service
|
-- Custom options which might be support (or not) by the default service
|
||||||
|
|
||||||
action: PROCEDURE [ANY, TUPLE [WSF_REQUEST, WSF_RESPONSE]]
|
|
||||||
-- Action to be executed on request incoming
|
|
||||||
|
|
||||||
feature {NONE} -- Implementation: Execution
|
|
||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
|
||||||
-- <Precursor>
|
|
||||||
do
|
|
||||||
action.call ([req, res])
|
|
||||||
end
|
|
||||||
|
|
||||||
invariant
|
invariant
|
||||||
connector_attached: connector /= Void
|
connector_attached: connector /= Void
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
create
|
||||||
|
make,
|
||||||
|
make_from_array
|
||||||
|
|
||||||
|
convert
|
||||||
|
make_from_array ({ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]]})
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make
|
||||||
|
do
|
||||||
|
create options.make (0)
|
||||||
|
end
|
||||||
|
|
||||||
|
make_from_array (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
|
||||||
|
do
|
||||||
|
make
|
||||||
|
across
|
||||||
|
a_options as opt
|
||||||
|
loop
|
||||||
|
if attached opt.item as o then
|
||||||
|
set_option (o.name, o.value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
option (a_name: READABLE_STRING_GENERAL): detachable ANY
|
||||||
|
do
|
||||||
|
Result := options.item (a_name)
|
||||||
|
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: HASH_TABLE [detachable ANY, READABLE_STRING_GENERAL]
|
||||||
|
-- Custom options which might be support (or not) by the default service
|
||||||
|
|
||||||
|
invariant
|
||||||
|
options_attached: options /= 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
|
||||||
62
library/server/wsf/src/service/wsf_to_wgi_service.e
Normal file
62
library/server/wsf/src/service/wsf_to_wgi_service.e
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
w_res.flush
|
||||||
|
end
|
||||||
|
if w_req /= Void then
|
||||||
|
w_req.destroy
|
||||||
|
end
|
||||||
|
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
|
||||||
@@ -26,7 +26,7 @@ class
|
|||||||
inherit
|
inherit
|
||||||
DEBUG_OUTPUT
|
DEBUG_OUTPUT
|
||||||
|
|
||||||
create {WSF_SERVICE}
|
create {WSF_TO_WGI_SERVICE}
|
||||||
make_from_wgi
|
make_from_wgi
|
||||||
|
|
||||||
convert
|
convert
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ note
|
|||||||
class
|
class
|
||||||
WSF_RESPONSE
|
WSF_RESPONSE
|
||||||
|
|
||||||
create {WSF_SERVICE}
|
create {WSF_TO_WGI_SERVICE}
|
||||||
make_from_wgi
|
make_from_wgi
|
||||||
|
|
||||||
convert
|
convert
|
||||||
@@ -117,6 +117,14 @@ feature -- Header output operation
|
|||||||
|
|
||||||
feature -- Output operation
|
feature -- Output operation
|
||||||
|
|
||||||
|
put_character (c: CHARACTER_8)
|
||||||
|
-- Send the character `c'
|
||||||
|
require
|
||||||
|
message_writable: message_writable
|
||||||
|
do
|
||||||
|
wgi_response.put_character (c)
|
||||||
|
end
|
||||||
|
|
||||||
put_string (s: READABLE_STRING_8)
|
put_string (s: READABLE_STRING_8)
|
||||||
-- Send the string `s'
|
-- Send the string `s'
|
||||||
require
|
require
|
||||||
@@ -269,6 +277,15 @@ feature -- Redirect
|
|||||||
redirect_now_custom (a_url, {HTTP_STATUS_CODE}.temp_redirect, Void, [a_content, a_content_type])
|
redirect_now_custom (a_url, {HTTP_STATUS_CODE}.temp_redirect, Void, [a_content, a_content_type])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Error reporting
|
||||||
|
|
||||||
|
put_error (a_message: READABLE_STRING_8)
|
||||||
|
-- Report error described by `a_message'
|
||||||
|
-- This might be used by the underlying connector
|
||||||
|
do
|
||||||
|
wgi_response.put_error (a_message)
|
||||||
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, 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)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -35,10 +35,12 @@ feature {NONE} -- Events
|
|||||||
app: NINO_SERVICE
|
app: NINO_SERVICE
|
||||||
wt: WORKER_THREAD
|
wt: WORKER_THREAD
|
||||||
e: EXECUTION_ENVIRONMENT
|
e: EXECUTION_ENVIRONMENT
|
||||||
|
w2w: WSF_TO_WGI_SERVICE
|
||||||
do
|
do
|
||||||
port_number := 0
|
port_number := 0
|
||||||
base_url := "test/"
|
base_url := "test/"
|
||||||
create app.make_custom (agent wgi_execute, base_url)
|
create w2w.make_from_service (Current)
|
||||||
|
create app.make_custom (w2w, base_url)
|
||||||
web_app := app
|
web_app := app
|
||||||
|
|
||||||
create wt.make (agent app.listen (port_number))
|
create wt.make (agent app.listen (port_number))
|
||||||
@@ -116,7 +118,7 @@ feature {NONE} -- Events
|
|||||||
page.put_string ("Bye")
|
page.put_string ("Bye")
|
||||||
end
|
end
|
||||||
|
|
||||||
page.send_to (res)
|
res.send (page)
|
||||||
end
|
end
|
||||||
|
|
||||||
test_url (a_query_url: READABLE_STRING_8): READABLE_STRING_8
|
test_url (a_query_url: READABLE_STRING_8): READABLE_STRING_8
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ feature -- Tests
|
|||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
new_request (a_meta: ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]]): WSF_REQUEST
|
new_request (a_meta: ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]]): WSF_REQUEST_NULL
|
||||||
local
|
local
|
||||||
wgi_req: WGI_REQUEST
|
wgi_req: WGI_REQUEST
|
||||||
do
|
do
|
||||||
create {WGI_REQUEST_NULL} wgi_req.make (Current, a_meta)
|
create {WGI_REQUEST_NULL} wgi_req.make (a_meta)
|
||||||
create Result.make_from_wgi (wgi_req)
|
create Result.make_from_wgi (wgi_req)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (s: WSF_SERVICE; a_meta: ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
make (a_meta: ARRAY [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
||||||
local
|
local
|
||||||
ht: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
|
ht: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]
|
||||||
i: WGI_NULL_INPUT_STREAM
|
i: WGI_NULL_INPUT_STREAM
|
||||||
c: WGI_NULL_CONNECTOR
|
c: WGI_NULL_CONNECTOR
|
||||||
do
|
do
|
||||||
create c.make (s)
|
create c.make
|
||||||
create i.make
|
create i.make
|
||||||
create ht.make (a_meta.count)
|
create ht.make (a_meta.count)
|
||||||
across
|
across
|
||||||
|
|||||||
16
library/server/wsf/tests/src/wsf_request_null.e
Normal file
16
library/server/wsf/tests/src/wsf_request_null.e
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_REQUEST_NULL}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_REQUEST_NULL
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_REQUEST
|
||||||
|
|
||||||
|
create {WSF_TO_WGI_SERVICE, WSF_SERVICE}
|
||||||
|
make_from_wgi
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user