Introduced WSF_ROUTER_SESSION

This fixes CQS violation from WSF_ROUTER.dispatch_and_return_handler (...): ? WSF_HANDLER
and related code, and this is more compliant with concurrency.

In addition, the WSF_ROUTER_SESSION can be enhanced in the future to answer more advanced needs.
This commit is contained in:
Jocelyn Fiat
2013-03-21 15:41:46 +01:00
parent ade9a30c03
commit 7c7bf9a3f8
9 changed files with 118 additions and 54 deletions

View File

@@ -1,6 +1,7 @@
note
description: "Summary description for {WSF_ROUTER_MAPPING}."
author: ""
description: "[
Describes a route or mapping for the WSF_ROUTER
]"
date: "$Date$"
revision: "$Revision$"
@@ -23,14 +24,14 @@ feature {NONE} -- Initialization
feature -- Access
associated_resource: READABLE_STRING_8
-- Name (URI, or URI template or regular expression or ...) of handled resource
-- Name (URI, or URI template or regular expression or ...) of handled resource.
deferred
ensure
assciated_resource_not_void: Result /= Void
end
handler: WSF_HANDLER
-- Handler associated with `Current' mapping
-- Handler associated with `Current' mapping.
deferred
ensure
handler_attached: Result /= Void
@@ -39,7 +40,7 @@ feature -- Access
feature -- Documentation
description: READABLE_STRING_32
-- Short description of associated mapping
-- Short description of associated mapping.
deferred
ensure
description_attached: Result /= Void
@@ -63,11 +64,13 @@ feature -- Status
deferred
end
routed_handler (req: WSF_REQUEST; res: WSF_RESPONSE; a_router: WSF_ROUTER): detachable WSF_HANDLER
-- Handler when `Current' matches the request `req'
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
-- Try using `Current' mapping and if it matches request `req'
-- execute associated handler and set this handler in session `sess'.
require
req_attached: req /= Void
res_attached: res /= Void
sess_attached: sess /= Void
a_router_attached: a_router /= Void
deferred
end
@@ -75,7 +78,7 @@ feature -- Status
feature -- Helper
path_from_request (req: WSF_REQUEST): READABLE_STRING_32
-- Path used by `Current' to check that mapping matches request `req'
-- Path used by `Current' to check that mapping matches request `req'.
require
req_attached: req /= Void
do