Applied recent changes on WGI_ and WSF_

Moved classes away from ewsgi, restructured, cleaned
This commit is contained in:
Jocelyn Fiat
2011-10-21 16:56:23 +02:00
parent 79e12b8d04
commit 14a2c01f41
62 changed files with 163 additions and 1626 deletions

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector" location="..\connector.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -1,11 +1,11 @@
note
description: "Summary description for {EWF_CGI_CONNECTOR}."
description: "Summary description for {WGI_CGI_CONNECTOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
EWF_CGI_CONNECTOR
WGI_CGI_CONNECTOR
inherit
WGI_CONNECTOR
@@ -22,8 +22,8 @@ feature -- Execution
rescued: BOOLEAN
do
if not rescued then
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make)
create res.make (create {EWF_CGI_OUTPUT_STREAM}.make)
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_CGI_INPUT_STREAM}.make)
create res.make (create {WGI_CGI_OUTPUT_STREAM}.make)
application.execute (req, res)
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for EWF_CGI_INPUT_STREAM."
description: "Summary description for WGI_CGI_INPUT_STREAM."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_CGI_INPUT_STREAM
WGI_CGI_INPUT_STREAM
inherit
WGI_INPUT_STREAM

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for EWF_CGI_OUTPUT_STREAM."
description: "Summary description for WGI_CGI_OUTPUT_STREAM."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_CGI_OUTPUT_STREAM
WGI_CGI_OUTPUT_STREAM
inherit
WGI_OUTPUT_STREAM

View File

@@ -0,0 +1,44 @@
note
description: "Summary description for {WGI_CONNECTOR}."
specification: "EWSGI/connector specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
date: "$Date$"
revision: "$Revision$"
deferred class
WGI_CONNECTOR
feature {NONE} -- Initialization
make (a_app: like application)
do
application := a_app
initialize
end
initialize
-- Initialize connector
do
end
feature {NONE} -- Access
application: WGI_APPLICATION
-- Gateway Application
feature -- Server
launch
deferred
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

View File

@@ -0,0 +1,16 @@
<?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="connector" uuid="61FBBC8E-558A-4079-920E-204946E54EFB" library_target="connector">
<target name="connector">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY/library/base/base-safe.ecf"/>
<library name="ewsgi" location="../ewsgi-safe.ecf"/>
<cluster name="common" location="./common" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-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="connector" uuid="61FBBC8E-558A-4079-920E-204946E54EFB" library_target="connector">
<target name="connector">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
<library name="ewsgi" location="../ewsgi.ecf"/>
<cluster name="common" location="./common" recursive="true"/>
</target>
</system>

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf" />
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector" location="..\connector.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi.ecf" />
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for {EWF_LIBFCGI_CONNECTOR}."
description: "Summary description for {WGI_LIBFCGI_CONNECTOR}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_LIBFCGI_CONNECTOR
WGI_LIBFCGI_CONNECTOR
inherit
WGI_CONNECTOR
@@ -22,8 +22,8 @@ feature {NONE} -- Initialization
initialize
do
create fcgi.make
create {EWF_LIBFCGI_INPUT_STREAM} input.make (fcgi)
create {EWF_LIBFCGI_OUTPUT_STREAM} output.make (fcgi)
create {WGI_LIBFCGI_INPUT_STREAM} input.make (fcgi)
create {WGI_LIBFCGI_OUTPUT_STREAM} output.make (fcgi)
end
feature -- Server

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for EWF_LIBFCGI_INPUT_STREAM."
description: "Summary description for WGI_LIBFCGI_INPUT_STREAM."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_LIBFCGI_INPUT_STREAM
WGI_LIBFCGI_INPUT_STREAM
inherit
WGI_INPUT_STREAM

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for {EWF_LIBFCGI_OUTPUT_STREAM}."
description: "Summary description for {WGI_LIBFCGI_OUTPUT_STREAM}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_LIBFCGI_OUTPUT_STREAM
WGI_LIBFCGI_OUTPUT_STREAM
inherit
WGI_OUTPUT_STREAM

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino-safe.ecf" readonly="false">

View File

@@ -10,6 +10,7 @@
<option warning="true" full_class_checking="true">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector" location="..\connector.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino.ecf" readonly="false">

View File

@@ -0,0 +1,72 @@
note
description: "Summary description for {NINO_APPLICATION}."
date: "$Date$"
revision: "$Revision$"
class
NINO_APPLICATION
create
make,
make_custom
feature {NONE} -- Implementation
make (a_callback: like {WGI_AGENT_APPLICATION}.callback)
-- Initialize `Current'.
do
make_custom (a_callback, Void)
end
make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING)
-- Initialize `Current'.
require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
local
app: WGI_AGENT_APPLICATION
do
create app.make (a_callback)
create connector.make_with_base (app, a_base_url)
end
connector: WGI_NINO_CONNECTOR
-- Web server connector
feature -- Status settings
configuration: HTTP_SERVER_CONFIGURATION
do
Result := connector.configuration
end
force_single_threaded
-- Force single threaded behavior
do
configuration.force_single_threaded := True
end
feature -- Server
listen (a_port: INTEGER)
do
configuration.http_server_port := a_port
connector.launch
end
shutdown
-- Shutdown the server
do
connector.server.shutdown_server
end
note
copyright: "2011-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

View File

@@ -1,11 +1,11 @@
note
description: "Summary description for {EWF_NINO_CONNECTOR}."
description: "Summary description for {WGI_NINO_CONNECTOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
EWF_NINO_CONNECTOR
WGI_NINO_CONNECTOR
inherit
WGI_CONNECTOR
@@ -68,7 +68,7 @@ feature -- Server
local
l_http_handler : HTTP_HANDLER
do
create {EWF_NINO_HANDLER} l_http_handler.make_with_callback (server, "NINO_HANDLER", Current)
create {WGI_NINO_HANDLER} l_http_handler.make_with_callback (server, "NINO_HANDLER", Current)
debug ("nino")
if attached base as l_base then
print ("Base=" + l_base + "%N")
@@ -84,8 +84,8 @@ feature -- Server
rescued: BOOLEAN
do
if not rescued then
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
create req.make (env, create {WGI_NINO_INPUT_STREAM}.make (a_input))
create res.make (create {WGI_NINO_OUTPUT_STREAM}.make (a_output))
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
application.execute (req, res)
else

View File

@@ -5,7 +5,7 @@ note
revision : "$Revision$"
class
EWF_NINO_HANDLER
WGI_NINO_HANDLER
inherit
HTTP_CONNECTION_HANDLER
@@ -23,7 +23,7 @@ feature {NONE} -- Initialization
callback := a_callback
end
callback: EWF_NINO_CONNECTOR
callback: WGI_NINO_CONNECTOR
feature -- Access

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for {EWF_NINO_INPUT_STREAM}."
description: "Summary description for {WGI_NINO_INPUT_STREAM}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_NINO_INPUT_STREAM
WGI_NINO_INPUT_STREAM
inherit
WGI_INPUT_STREAM
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
set_nino_input (a_nino_input)
end
feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
set_nino_input (i: like nino_input)
do

View File

@@ -1,12 +1,12 @@
note
description: "Summary description for {EWF_NINO_OUTPUT_STREAM}."
description: "Summary description for {WGI_NINO_OUTPUT_STREAM}."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class
EWF_NINO_OUTPUT_STREAM
WGI_NINO_OUTPUT_STREAM
inherit
WGI_OUTPUT_STREAM
@@ -26,7 +26,7 @@ feature {NONE} -- Initialization
set_nino_output (a_nino_output)
end
feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
set_nino_output (o: like nino_output)
do