Moved all *_CONTEXT_* router related classes into wsf_router_context.ecf library
This makes wsf simpler to discover. And advanced context enabled handler, mapping, ... are still available for now in wsf_router_context.ecf library
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
note
|
||||
description: "Summary description for {WSF_STARTS_WITH_AGENT_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_STARTS_WITH_AGENT_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_STARTS_WITH_CONTEXT_HANDLER [C]
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature -- Change
|
||||
|
||||
make (a_action: like action)
|
||||
do
|
||||
action := a_action
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
action: PROCEDURE [ANY, TUPLE [start_path: READABLE_STRING_8; context: C; request: WSF_REQUEST; response: WSF_RESPONSE]]
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (a_start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
action.call ([a_start_path, ctx, 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
|
||||
@@ -0,0 +1,47 @@
|
||||
note
|
||||
description: "Summary description for {WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTED_SERVICE
|
||||
|
||||
feature -- Mapping helper: starts_with
|
||||
|
||||
map_starts_with (a_uri: READABLE_STRING_8; h: WSF_STARTS_WITH_CONTEXT_HANDLER [C])
|
||||
do
|
||||
map_starts_with_request_methods (a_uri, h, Void)
|
||||
end
|
||||
|
||||
map_starts_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_STARTS_WITH_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
router.map_with_request_methods (create {WSF_STARTS_WITH_CONTEXT_MAPPING [C]}.make (a_uri, h), rqst_methods)
|
||||
end
|
||||
|
||||
feature -- Mapping helper: starts_with agent
|
||||
|
||||
map_starts_with_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||
do
|
||||
map_starts_with_agent_with_request_methods (a_uri, proc, Void)
|
||||
end
|
||||
|
||||
map_starts_with_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
map_starts_with_request_methods (a_uri, create {WSF_STARTS_WITH_AGENT_CONTEXT_HANDLER [C] }.make (proc), rqst_methods)
|
||||
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
|
||||
@@ -0,0 +1,39 @@
|
||||
note
|
||||
description: "Summary description for {WSF_STARTS_WITH_ROUTING_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_STARTS_WITH_ROUTING_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTING_HANDLER
|
||||
|
||||
WSF_STARTS_WITH_CONTEXT_HANDLER [C]
|
||||
rename
|
||||
execute as execute_with_context
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_router
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute_with_context (a_start_path: READABLE_STRING_8; 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
|
||||
@@ -0,0 +1,38 @@
|
||||
note
|
||||
description: "Summary description for {WSF_STARTS_WITH_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_STARTS_WITH_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_HANDLER
|
||||
|
||||
WSF_ROUTER_MAPPING_FACTORY
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (a_start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
deferred
|
||||
end
|
||||
|
||||
feature {WSF_ROUTER} -- Mapping
|
||||
|
||||
new_mapping (a_uri: READABLE_STRING_8): WSF_ROUTER_MAPPING
|
||||
do
|
||||
create {WSF_STARTS_WITH_CONTEXT_MAPPING [C]} Result.make (a_uri, Current)
|
||||
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
|
||||
@@ -0,0 +1,64 @@
|
||||
note
|
||||
description: "Summary description for WSF_STARTS_WITH_CONTEXT_MAPPING."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_STARTS_WITH_CONTEXT_MAPPING [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_STARTS_WITH_MAPPING_I
|
||||
undefine
|
||||
debug_output
|
||||
end
|
||||
|
||||
WSF_ROUTER_MAPPING
|
||||
redefine
|
||||
debug_output
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature -- Access
|
||||
|
||||
handler: WSF_STARTS_WITH_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- change
|
||||
|
||||
set_handler (h: like handler)
|
||||
do
|
||||
handler := h
|
||||
end
|
||||
|
||||
feature {NONE} -- Execution
|
||||
|
||||
execute_handler (h: like handler; a_start_path: like uri; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute handler `h' with `req' and `res' for Current mapping
|
||||
local
|
||||
ctx: C
|
||||
do
|
||||
create ctx.make (req, Current)
|
||||
h.execute (a_start_path, ctx, req, res)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := Precursor + " {" + ({C}).name + "}"
|
||||
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
|
||||
@@ -0,0 +1,31 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_AGENT_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_AGENT_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_URI_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_AGENT_CONTEXT_HANDLER [C]
|
||||
rename
|
||||
set_action as make
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
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
|
||||
@@ -0,0 +1,47 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_CONTEXT_ROUTED_SERVICE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTED_SERVICE
|
||||
|
||||
feature -- Mapping helper: uri
|
||||
|
||||
map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_CONTEXT_HANDLER [C])
|
||||
do
|
||||
map_uri_with_request_methods (a_uri, h, Void)
|
||||
end
|
||||
|
||||
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
router.map_with_request_methods (create {WSF_URI_CONTEXT_MAPPING [C]}.make (a_uri, h), rqst_methods)
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri agent
|
||||
|
||||
map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||
do
|
||||
map_uri_agent_with_request_methods (a_uri, proc, Void)
|
||||
end
|
||||
|
||||
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
map_uri_with_request_methods (a_uri, create {WSF_URI_AGENT_CONTEXT_HANDLER [C] }.make (proc), rqst_methods)
|
||||
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
|
||||
@@ -0,0 +1,43 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_ROUTING_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_ROUTING_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTING_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_URI_CONTEXT_HANDLER [C]
|
||||
rename
|
||||
execute as uri_execute
|
||||
select
|
||||
uri_execute
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_router
|
||||
|
||||
feature -- Execution
|
||||
|
||||
uri_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- <Precursor>
|
||||
--| For such routing handler, the previous context is lost
|
||||
do
|
||||
execute_with_context (ctx, 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
|
||||
@@ -0,0 +1,32 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_ROUTER_MAPPING_FACTORY
|
||||
|
||||
feature {WSF_ROUTER} -- Mapping
|
||||
|
||||
new_mapping (a_uri: READABLE_STRING_8): WSF_ROUTER_MAPPING
|
||||
do
|
||||
create {WSF_URI_CONTEXT_MAPPING [C]} Result.make (a_uri, Current)
|
||||
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
|
||||
@@ -0,0 +1,53 @@
|
||||
note
|
||||
description: "Summary description for WSF_URI_CONTEXT_MAPPING."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_CONTEXT_MAPPING [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_URI_MAPPING_I
|
||||
undefine
|
||||
debug_output
|
||||
end
|
||||
|
||||
WSF_ROUTER_CONTEXT_MAPPING [C]
|
||||
|
||||
create
|
||||
make,
|
||||
make_trailing_slash_ignored
|
||||
|
||||
feature -- Access
|
||||
|
||||
handler: WSF_URI_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- Change
|
||||
|
||||
set_handler (h: like handler)
|
||||
do
|
||||
handler := h
|
||||
end
|
||||
|
||||
feature {NONE} -- Execution
|
||||
|
||||
execute_handler (h: like handler; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
ctx: C
|
||||
do
|
||||
create ctx.make (req, Current)
|
||||
h.execute (ctx, 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
|
||||
@@ -0,0 +1,31 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_TEMPLATE_AGENT_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_TEMPLATE_AGENT_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_AGENT_CONTEXT_HANDLER [C]
|
||||
rename
|
||||
set_action as make
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
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
|
||||
@@ -0,0 +1,47 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTED_SERVICE
|
||||
|
||||
feature -- Mapping helper: uri
|
||||
|
||||
map_uri_template (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_CONTEXT_HANDLER [C])
|
||||
do
|
||||
map_uri_template_with_request_methods (a_tpl, h, Void)
|
||||
end
|
||||
|
||||
map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
router.map_with_request_methods (create {WSF_URI_TEMPLATE_CONTEXT_MAPPING [C]}.make (a_tpl, h), rqst_methods)
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri agent
|
||||
|
||||
map_uri_template_agent (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||
do
|
||||
map_uri_template_agent_with_request_methods (a_tpl, proc, Void)
|
||||
end
|
||||
|
||||
map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
do
|
||||
map_uri_template_with_request_methods (a_tpl, create {WSF_URI_TEMPLATE_AGENT_CONTEXT_HANDLER [C] }.make (proc), rqst_methods)
|
||||
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
|
||||
@@ -0,0 +1,42 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_TEMPLATE_FILTER_CONTEXT_HANDLER}."
|
||||
author : "$Author$"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_TEMPLATE_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_FILTER_HANDLER
|
||||
redefine
|
||||
next
|
||||
end
|
||||
|
||||
WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- Access
|
||||
|
||||
next: detachable WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
|
||||
-- Next handler
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
if attached next as n then
|
||||
n.execute (ctx, req, res)
|
||||
end
|
||||
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
|
||||
@@ -0,0 +1,43 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTING_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
|
||||
rename
|
||||
execute as uri_template_execute
|
||||
select
|
||||
uri_template_execute
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_router
|
||||
|
||||
feature -- Execution
|
||||
|
||||
uri_template_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- <Precursor>
|
||||
--| For such routing handler, the previous context is lost
|
||||
do
|
||||
execute_with_context (ctx, 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
|
||||
@@ -0,0 +1,32 @@
|
||||
note
|
||||
description: "Summary description for WSF_URI_TEMPLATE_CONTEXT_HANDLER."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_TEMPLATE_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_CONTEXT_HANDLER [C]
|
||||
|
||||
WSF_ROUTER_MAPPING_FACTORY
|
||||
|
||||
feature {WSF_ROUTER} -- Mapping
|
||||
|
||||
new_mapping (a_tpl: READABLE_STRING_8): WSF_ROUTER_MAPPING
|
||||
do
|
||||
create {WSF_URI_TEMPLATE_CONTEXT_MAPPING [C]} Result.make (a_tpl, Current)
|
||||
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
|
||||
@@ -0,0 +1,53 @@
|
||||
note
|
||||
description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_MAPPING}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_URI_TEMPLATE_CONTEXT_MAPPING [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_URI_TEMPLATE_MAPPING_I
|
||||
undefine
|
||||
debug_output
|
||||
end
|
||||
|
||||
WSF_ROUTER_CONTEXT_MAPPING [C]
|
||||
|
||||
create
|
||||
make,
|
||||
make_from_template
|
||||
|
||||
feature -- Access
|
||||
|
||||
handler: WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- Change
|
||||
|
||||
set_handler (h: like handler)
|
||||
do
|
||||
handler := h
|
||||
end
|
||||
|
||||
feature {NONE} -- Execution
|
||||
|
||||
execute_handler (h: like handler; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
ctx: detachable C
|
||||
do
|
||||
create ctx.make (req, Current)
|
||||
h.execute (ctx, 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
|
||||
@@ -0,0 +1,41 @@
|
||||
note
|
||||
description: "Summary description for {WSF_AGENT_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_AGENT_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- Change
|
||||
|
||||
set_action (a_action: like action)
|
||||
do
|
||||
action := a_action
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
action: PROCEDURE [ANY, TUPLE [context: C; request: WSF_REQUEST; response: WSF_RESPONSE]]
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
action.call ([ctx, 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
|
||||
29
library/server/wsf/router_context/wsf_context_handler.e
Normal file
29
library/server/wsf/router_context/wsf_context_handler.e
Normal file
@@ -0,0 +1,29 @@
|
||||
note
|
||||
description: "Summary description for {WSF_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_HANDLER
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
deferred
|
||||
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
|
||||
@@ -0,0 +1,42 @@
|
||||
note
|
||||
description: "Summary description for {WSF_FILTER_CONTEXT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_FILTER_HANDLER
|
||||
redefine
|
||||
next
|
||||
end
|
||||
|
||||
WSF_CONTEXT_HANDLER [C]
|
||||
|
||||
feature -- Access
|
||||
|
||||
next: detachable WSF_CONTEXT_HANDLER [C]
|
||||
-- Next handler
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
if attached next as n then
|
||||
n.execute (ctx, req, res)
|
||||
end
|
||||
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
|
||||
43
library/server/wsf/router_context/wsf_handler_context.e
Normal file
43
library/server/wsf/router_context/wsf_handler_context.e
Normal file
@@ -0,0 +1,43 @@
|
||||
note
|
||||
description: "[
|
||||
Context for the handler execution
|
||||
It provides information related to the matching handler at runtime, i.e:
|
||||
- request: WSF_REQUEST -- Associated request
|
||||
- path: READABLE_STRING_8 -- Associated path
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_HANDLER_CONTEXT
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (req: like request; map: like mapping)
|
||||
do
|
||||
request := req
|
||||
mapping := map
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
request: WSF_REQUEST
|
||||
-- Associated request
|
||||
|
||||
mapping: WSF_ROUTER_MAPPING
|
||||
-- Associated mapping
|
||||
|
||||
;note
|
||||
copyright: "2011-2013, 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
|
||||
@@ -0,0 +1,41 @@
|
||||
note
|
||||
description: "Summary description for {WSF_ROUTER_CONTEXT_MAPPING}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_ROUTER_CONTEXT_MAPPING [C -> WSF_HANDLER_CONTEXT create make end]
|
||||
|
||||
inherit
|
||||
WSF_ROUTER_MAPPING
|
||||
redefine
|
||||
debug_output
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
handler: WSF_CONTEXT_HANDLER [C]
|
||||
-- Handler associated with Current mapping.
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := Precursor + " {" + ({C}).name + "}"
|
||||
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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user