From 2e774f2e1087c48058a1c4f49fa75b9dda89327d Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Mon, 22 Oct 2012 14:27:03 +0200 Subject: [PATCH] Added WSF_ROUTING_CONTEXT_HANDLER --- .../context/wsf_routing_context_handler.e | 38 +++++++++++++++++++ ...wsf_uri_template_routing_context_handler.e | 6 ++- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 library/server/wsf/router/context/wsf_routing_context_handler.e diff --git a/library/server/wsf/router/context/wsf_routing_context_handler.e b/library/server/wsf/router/context/wsf_routing_context_handler.e new file mode 100644 index 00000000..25e784da --- /dev/null +++ b/library/server/wsf/router/context/wsf_routing_context_handler.e @@ -0,0 +1,38 @@ +note + description: "Routing handler with context support" + author: "$Author$" + revision: "$Revision$" + +class + WSF_ROUTING_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end] + +inherit + WSF_ROUTING_HANDLER + + WSF_CONTEXT_HANDLER [C] + rename + execute as execute_with_context + end + +create + make, + make_with_router + +feature -- Execution + + execute_with_context (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) + do + execute (req, res) + end + +note + copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/library/server/wsf/router/support/uri_template_with_context/helpers/wsf_uri_template_routing_context_handler.e b/library/server/wsf/router/support/uri_template_with_context/helpers/wsf_uri_template_routing_context_handler.e index 7a14c80c..6ddb157c 100644 --- a/library/server/wsf/router/support/uri_template_with_context/helpers/wsf_uri_template_routing_context_handler.e +++ b/library/server/wsf/router/support/uri_template_with_context/helpers/wsf_uri_template_routing_context_handler.e @@ -8,11 +8,13 @@ class WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end] inherit - WSF_ROUTING_HANDLER + WSF_ROUTING_CONTEXT_HANDLER [C] WSF_URI_TEMPLATE_CONTEXT_HANDLER [C] rename execute as uri_template_execute + select + uri_template_execute end create @@ -25,7 +27,7 @@ feature -- Execution -- --| For such routing handler, the previous context is lost do - execute (req, res) + execute_with_context (ctx, req, res) end note