From 94a91fa4aa69eb3ceb6985f7de7ab443c7f5d851 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 26 Sep 2012 09:45:33 +0200 Subject: [PATCH] added missing wsf_routing_filter --- .../wsf/src/filter/wsf_routing_filter.e | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 library/server/wsf/src/filter/wsf_routing_filter.e diff --git a/library/server/wsf/src/filter/wsf_routing_filter.e b/library/server/wsf/src/filter/wsf_routing_filter.e new file mode 100644 index 00000000..349178d6 --- /dev/null +++ b/library/server/wsf/src/filter/wsf_routing_filter.e @@ -0,0 +1,75 @@ +note + description: "Routing filter." + author: "Olivier Ligot" + date: "$Date$" + revision: "$Revision$" + +class + WSF_ROUTING_FILTER + +inherit + WSF_FILTER + +create + make + +feature {NONE} -- Initialization + + make (a_router: WSF_ROUTER) + do + router := a_router + ensure + router_set: router = a_router + end + +feature -- Access + + router: WSF_ROUTER + -- Router + + execute_default_action: detachable PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]] + -- `execute_default' action + +feature -- Element change + + set_execute_default_action (an_action: like execute_default_action) + -- Set `execute_default_action' to `an_action' + do + execute_default_action := an_action + ensure + execute_default_action_set: execute_default_action = an_action + end + +feature -- Basic operations + + execute (req: WSF_REQUEST; res: WSF_RESPONSE) + -- Execute the filter + do + if attached router.dispatch_and_return_handler (req, res) then + check router.is_dispatched end + else + execute_default (req, res) + end + execute_next (req, res) + end + + execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) + do + if attached execute_default_action as action then + action.call ([req, res]) + else + do_nothing + 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