Marked most of the *_with_request_methods procedure obsolete by the same feature name without the "_with_request_methods".
Added argument passing request methods to feature without the _with_request_methods. Prefer "thread" concurrency for now in examples.
This commit is contained in:
@@ -11,16 +11,18 @@ inherit
|
||||
|
||||
feature -- Mapping helper: uri
|
||||
|
||||
map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER)
|
||||
-- Map `h' as handler for `a_uri'
|
||||
map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `h' as handler for `a_uri', according to `rqst_methods'.
|
||||
do
|
||||
map_uri_with_request_methods (a_uri, h, Void)
|
||||
router.map (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
||||
end
|
||||
|
||||
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `h' as handler for `a_uri' for request methods `rqst_methods'.
|
||||
obsolete
|
||||
"Use directly `map_uri' [June/2015]"
|
||||
do
|
||||
router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
||||
map_uri (a_uri, h, rqst_methods)
|
||||
end
|
||||
|
||||
map_uri_response (a_uri: READABLE_STRING_8; h: WSF_URI_RESPONSE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
@@ -28,21 +30,23 @@ feature -- Mapping helper: uri
|
||||
require
|
||||
h_attached: h /= Void
|
||||
do
|
||||
router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
||||
router.map (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri agent
|
||||
|
||||
map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||
-- Map `proc' as handler for `a_uri'
|
||||
map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `proc' as handler for `a_uri', according to `rqst_methods'.
|
||||
do
|
||||
map_uri_agent_with_request_methods (a_uri, proc, Void)
|
||||
map_uri (a_uri, create {WSF_URI_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||
end
|
||||
|
||||
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `proc' as handler for `a_uri' for request methods `rqst_methods'.
|
||||
obsolete
|
||||
"Use directly `map_uri_agent' [June/2015]"
|
||||
do
|
||||
map_uri_with_request_methods (a_uri, create {WSF_URI_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||
map_uri_agent (a_uri, proc, rqst_methods)
|
||||
end
|
||||
|
||||
map_uri_response_agent (a_uri: READABLE_STRING_8; a_action: like {WSF_URI_RESPONSE_AGENT_HANDLER}.action; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
|
||||
@@ -12,7 +12,7 @@ inherit
|
||||
feature -- Mapping helper: uri template
|
||||
|
||||
map_uri_template (a_tpl: STRING; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `h' as handler for `a_tpl'.
|
||||
-- Map `h' as handler for `a_tpl', according to `rqst_methods'.
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
h_attached: h /= Void
|
||||
@@ -43,7 +43,7 @@ feature -- Mapping helper: uri template
|
||||
feature -- Mapping helper: uri template agent
|
||||
|
||||
map_uri_template_agent (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `proc' as handler for `a_tpl'
|
||||
-- Map `proc' as handler for `a_tpl', according to `rqst_methods'.
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
proc_attached: proc /= Void
|
||||
|
||||
@@ -65,11 +65,13 @@ feature {NONE} -- Initialization
|
||||
feature -- Mapping
|
||||
|
||||
map (a_mapping: WSF_ROUTER_MAPPING; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `a_mapping'.
|
||||
-- Map `a_mapping',
|
||||
-- if `rqst_methods' is set, accept only request method in `rqst_methods'.
|
||||
-- if `rqst_method' is Void, accept any request methods.
|
||||
require
|
||||
a_mapping_attached: a_mapping /= Void
|
||||
do
|
||||
extend (create {WSF_ROUTER_ITEM}.make_with_request_methods (a_mapping, rqst_methods))
|
||||
extend (create {WSF_ROUTER_ITEM}.make (a_mapping, rqst_methods))
|
||||
end
|
||||
|
||||
map_with_request_methods (a_mapping: WSF_ROUTER_MAPPING; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
@@ -120,6 +122,8 @@ feature -- Mapping handler
|
||||
|
||||
handle (a_resource: READABLE_STRING_8; f: WSF_ROUTER_MAPPING_FACTORY; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map the mapping created by factory `f' for resource `a_resource'.
|
||||
-- if `rqst_methods' is set, accept only request method in `rqst_methods'.
|
||||
-- if `rqst_method' is Void, accept any request methods.
|
||||
require
|
||||
a_resource_attached: a_resource /= Void
|
||||
f_attached: f /= Void
|
||||
|
||||
@@ -16,19 +16,13 @@ inherit
|
||||
DEBUG_OUTPUT
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_request_methods
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (m: like mapping)
|
||||
make (m: like mapping; r: like request_methods)
|
||||
do
|
||||
mapping := m
|
||||
end
|
||||
|
||||
make_with_request_methods (m: like mapping; r: like request_methods)
|
||||
do
|
||||
make (m)
|
||||
set_request_methods (r)
|
||||
end
|
||||
|
||||
@@ -71,7 +65,7 @@ invariant
|
||||
mapping_attached: mapping /= Void
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
Reference in New Issue
Block a user