Export request and response from WGI_EXECUTION to itself.

Added WSF_FILTERED_ROUTED_SKELETON_EXECUTION
This commit is contained in:
2015-04-02 18:23:58 +02:00
parent d8ea9ba63c
commit a1a620a9c3
3 changed files with 77 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
response := res response := res
end end
feature {NONE} -- Access feature {WGI_EXECUTION} -- Access
request: WGI_REQUEST request: WGI_REQUEST
-- Request data. -- Request data.

View File

@@ -0,0 +1,68 @@
note
description: "[
Skeleton execution based on filtered routed execution.
]"
author: "$Author$"
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_FILTERED_ROUTED_SKELETON_EXECUTION
inherit
WSF_ROUTED_SKELETON_EXECUTION
undefine
execute
redefine
initialize
end
WSF_FILTERED_EXECUTION
redefine
initialize
end
WSF_FILTER
rename
execute as filter_execute
end
feature {NONE} -- Initialize
initialize
local
f: like filter
do
Precursor {WSF_ROUTED_SKELETON_EXECUTION}
Precursor {WSF_FILTERED_EXECUTION}
-- Current is a WSF_FILTER as well in order to call the router
-- let's add Current at the end of the filter chain.
from
f := filter
until
not attached f.next as l_next
loop
f := l_next
end
f.set_next (Current)
end
feature -- Execute Filter
filter_execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute the filter.
do
execute_skeleton (req, res)
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -19,17 +19,19 @@ inherit
feature -- Execution feature -- Execution
execute execute
-- <Precursor>
do
execute_skeleton (request, response)
end
execute_skeleton (req: WSF_REQUEST; res: WSF_RESPONSE)
-- If the service is available, and request URI is not too long, dispatch the request -- If the service is available, and request URI is not too long, dispatch the request
-- and if handler is not found, execute the default procedure `execute_default'. -- and if handler is not found, execute the default procedure `execute_default'.
local local
l_sess: WSF_ROUTER_SESSION l_sess: WSF_ROUTER_SESSION
req: WSF_REQUEST; res: WSF_RESPONSE
do do
req := request --| When we reach here, the request has already passed check for 400 (Bad request),
res := response --| which is implemented in WSF_REQUEST.make_from_wgi (when it calls `analyze').
--| When we reach here, the request has already passed check for 400 (Bad request),
--| which is implemented in WSF_REQUEST.make_from_wgi (when it calls `analyze').
if unavailable then if unavailable then
handle_unavailable (res) handle_unavailable (res)
elseif requires_proxy (req) then elseif requires_proxy (req) then