Protected export of WSF_RESPONSE_MESSAGE.send_to
Added WSF_DEFAULT_RESPONSE_SERVICE Added simple WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI class to load launch option from ini file. Removed a few obsolete features
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
note
|
||||
description: "Summary description for {WSF_DEFAULT_RESPONSE_SERVICE}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_DEFAULT_RESPONSE_SERVICE
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
WSF_RESPONSE_SERVICE
|
||||
|
||||
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
|
||||
@@ -14,8 +14,7 @@ create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch,
|
||||
make_and_launch_with_options -- obsolete
|
||||
make_callback_and_launch
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
note
|
||||
description: "Summary description for {WSF_DEFAULT_RESPONSE_SERVICE}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_DEFAULT_RESPONSE_SERVICE
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
WSF_RESPONSE_SERVICE
|
||||
|
||||
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
|
||||
@@ -14,8 +14,7 @@ create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch,
|
||||
make_and_launch_with_options -- obsolete
|
||||
make_callback_and_launch
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
note
|
||||
description: "Summary description for {WSF_DEFAULT_RESPONSE_SERVICE}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_DEFAULT_RESPONSE_SERVICE
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE
|
||||
|
||||
WSF_RESPONSE_SERVICE
|
||||
|
||||
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
|
||||
@@ -15,8 +15,7 @@ create
|
||||
make,
|
||||
make_and_launch,
|
||||
make_callback,
|
||||
make_callback_and_launch,
|
||||
make_and_launch_with_options -- obsolete
|
||||
make_callback_and_launch
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
|
||||
@@ -104,7 +104,7 @@ feature -- Element change
|
||||
answer_head_request_method := b
|
||||
end
|
||||
|
||||
feature -- Basic operations
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Basic operations
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
do
|
||||
|
||||
@@ -150,7 +150,7 @@ feature -- Element change
|
||||
update_content_length
|
||||
end
|
||||
|
||||
feature -- Output
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Output
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
local
|
||||
|
||||
@@ -110,7 +110,7 @@ feature -- Element change
|
||||
body := b
|
||||
end
|
||||
|
||||
feature -- Output
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Output
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
local
|
||||
|
||||
@@ -79,7 +79,7 @@ feature -- Element change
|
||||
l_body.append (a_string)
|
||||
end
|
||||
|
||||
feature -- Output
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Output
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
local
|
||||
|
||||
@@ -70,7 +70,7 @@ feature -- Element change
|
||||
content_type := Void
|
||||
end
|
||||
|
||||
feature -- Output
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Output
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
local
|
||||
|
||||
@@ -11,13 +11,20 @@ inherit
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_and_launch
|
||||
frozen make_and_launch
|
||||
local
|
||||
l_launcher: G
|
||||
do
|
||||
initialize
|
||||
create l_launcher.make_and_launch (Current, service_options)
|
||||
end
|
||||
|
||||
initialize
|
||||
-- Initialize current service
|
||||
--| Could be redefine to set custom service option(s)
|
||||
do
|
||||
end
|
||||
|
||||
service_options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
|
||||
|
||||
feature -- Default service options
|
||||
|
||||
@@ -66,13 +66,6 @@ feature {NONE} -- Initialization
|
||||
make (create {WSF_CALLBACK_SERVICE}.make (a_callback), a_options)
|
||||
end
|
||||
|
||||
frozen make_and_launch_with_options (a_callback: like {WSF_CALLBACK_SERVICE}.callback; a_options: like options)
|
||||
obsolete
|
||||
"[2012-Mars-20] Use make_callback_and_launch (a_callback, a_options)"
|
||||
do
|
||||
make_callback_and_launch (a_callback, a_options)
|
||||
end
|
||||
|
||||
initialize
|
||||
-- Initialize Current using `options' if attached
|
||||
-- and build the connector
|
||||
|
||||
@@ -14,7 +14,14 @@ note
|
||||
class
|
||||
WSF_SERVICE_LAUNCHER_OPTIONS
|
||||
|
||||
inherit
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create,
|
||||
make,
|
||||
make_from_array
|
||||
|
||||
@@ -23,9 +30,15 @@ convert
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
default_create
|
||||
do
|
||||
Precursor
|
||||
create options.make (0)
|
||||
end
|
||||
|
||||
make
|
||||
do
|
||||
create options.make (0)
|
||||
default_create
|
||||
end
|
||||
|
||||
make_from_array (a_options: ARRAY [TUPLE [name: READABLE_STRING_GENERAL; value: detachable ANY]])
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
note
|
||||
description: "[
|
||||
Options used by WSF_SERVICE_LAUNCHER
|
||||
Built from ini configuration file
|
||||
]"
|
||||
|
||||
class
|
||||
WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI
|
||||
|
||||
inherit
|
||||
WSF_SERVICE_LAUNCHER_OPTIONS
|
||||
|
||||
create
|
||||
make_from_file
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_from_file (a_filename: READABLE_STRING_32)
|
||||
-- Initialize `Current'.
|
||||
do
|
||||
make
|
||||
import (a_filename)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
import (a_filename: READABLE_STRING_32)
|
||||
-- Import ini file content
|
||||
local
|
||||
f: PLAIN_TEXT_FILE
|
||||
l,v: STRING_8
|
||||
p: INTEGER
|
||||
do
|
||||
--FIXME: handle unicode filename here.
|
||||
create f.make (a_filename)
|
||||
if f.exists and f.is_readable then
|
||||
f.open_read
|
||||
from
|
||||
f.read_line
|
||||
until
|
||||
f.exhausted
|
||||
loop
|
||||
l := f.last_string
|
||||
l.left_adjust
|
||||
if not l.is_empty and then l[1] /= '#' then
|
||||
p := l.index_of ('=', 1)
|
||||
if p > 1 then
|
||||
v := l.substring (p + 1, l.count)
|
||||
l.keep_head (p - 1)
|
||||
v.left_adjust
|
||||
v.right_adjust
|
||||
l.right_adjust
|
||||
set_option (l.as_lower, v)
|
||||
end
|
||||
end
|
||||
f.read_line
|
||||
end
|
||||
f.close
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -265,22 +265,6 @@ feature -- Output operation
|
||||
|
||||
feature -- Response object
|
||||
|
||||
put_response (a_message: WSF_RESPONSE_MESSAGE)
|
||||
-- Set `a_message' as the whole response to the client
|
||||
--| `a_message' is responsible to sent the status code, the header and the content
|
||||
obsolete
|
||||
"[2012-Mars-19] Use `send (a_message)' "
|
||||
require
|
||||
header_not_committed: not header_committed
|
||||
status_not_committed: not status_committed
|
||||
no_message_committed: not message_committed
|
||||
do
|
||||
a_message.send_to (Current)
|
||||
ensure
|
||||
status_committed: status_committed
|
||||
header_committed: header_committed
|
||||
end
|
||||
|
||||
send (a_message: WSF_RESPONSE_MESSAGE)
|
||||
-- Set `a_message' as the whole response to the client
|
||||
--| `a_message' is responsible to sent the status code, the header and the content
|
||||
|
||||
@@ -7,9 +7,11 @@ note
|
||||
deferred class
|
||||
WSF_RESPONSE_MESSAGE
|
||||
|
||||
feature -- Output
|
||||
feature {WSF_SERVICE, WSF_RESPONSE} -- Output
|
||||
|
||||
send_to (res: WSF_RESPONSE)
|
||||
-- Send Current message to `res'
|
||||
--| This should not be called by user's code directly
|
||||
require
|
||||
header_not_committed: not res.header_committed
|
||||
status_not_committed: not res.status_committed
|
||||
|
||||
Reference in New Issue
Block a user