Design change, now we have req' REQUEST and res' RESPONSE instead of just `ctx'

This commit is contained in:
Jocelyn Fiat
2011-07-13 16:13:25 +02:00
parent 4e2f0dbc72
commit ac97d6019b
8 changed files with 112 additions and 32 deletions

View File

@@ -23,13 +23,13 @@ feature {NONE} -- Implementation
feature {NONE} -- Implementation
callback: PROCEDURE [ANY, TUPLE [like new_request_context]]
callback: PROCEDURE [ANY, TUPLE [req: like new_request_context; res: like new_response]]
-- Procedure called on `execute'
execute (ctx: like new_request_context)
execute (req: like new_request_context; res: like new_response)
-- Execute the request
do
callback.call ([ctx])
callback.call ([req, res])
end
invariant

View File

@@ -30,12 +30,17 @@ feature -- Execution
feature -- Factory
new_request_context (env: GW_ENVIRONMENT; a_input: GW_INPUT_STREAM; a_output: GW_OUTPUT_STREAM): GW_REQUEST_CONTEXT
new_request_context (env: GW_ENVIRONMENT; a_input: GW_INPUT_STREAM): GW_REQUEST_CONTEXT
do
create {GW_REQUEST_CONTEXT_IMP} Result.make (env, a_input, a_output)
create {GW_REQUEST_CONTEXT_IMP} Result.make (env, a_input)
Result.execution_variables.set_variable (request_count.out, "REQUEST_COUNT")
end
new_response (a_output: GW_OUTPUT_STREAM): GW_RESPONSE
do
create {GW_RESPONSE_IMP} Result.make (a_output)
end
;note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"

View File

@@ -23,13 +23,12 @@ create
feature {NONE} -- Initialization
make (env: GW_ENVIRONMENT; a_input: like input; a_output: like output)
make (env: GW_ENVIRONMENT; a_input: like input)
require
env_attached: env /= Void
do
create error_handler.make
input := a_input
output := a_output
environment := env
content_length := env.content_length_value
create execution_variables.make (10)
@@ -70,10 +69,7 @@ feature {NONE} -- Initialization
extract_variables
end
feature -- Access: Input/Output
output: GW_OUTPUT_STREAM
-- Server output channel
feature -- Access: Input
input: GW_INPUT_STREAM
-- Server input channel