forked from jocelyn/EWF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsf_routing_handler.e
72 lines (58 loc) · 1.45 KB
/
wsf_routing_handler.e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
note
description: "Summary description for {WSF_ROUTING_HANDLER}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_ROUTING_HANDLER
inherit
WSF_HANDLER
feature {NONE} -- Initialization
make (n: INTEGER)
do
create router.make (n)
end
feature -- Access
router: WSF_ROUTER
feature -- Access
count: INTEGER
-- Count of maps handled by current
do
Result := router.count
end
base_url: detachable READABLE_STRING_8
do
Result := router.base_url
end
feature -- Element change
set_base_url (a_base_url: like base_url)
-- Set `base_url' to `a_base_url'
-- make sure no map is already added (i.e: count = 0)
require
no_handler_set: count = 0
do
router.set_base_url (a_base_url)
end
feature -- Execution
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute request handler
local
sess: WSF_ROUTER_SESSION
do
create sess
router.dispatch (req, res, sess)
if not sess.dispatched then
res.put_header ({HTTP_STATUS_CODE}.not_found, <<[{HTTP_HEADER_NAMES}.header_content_length, "0"]>>)
end
end
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