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:
Jocelyn Fiat
2012-05-25 20:17:55 +02:00
parent aa6a1f2b8a
commit 6cff00428b
27 changed files with 282 additions and 72 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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]])

View File

@@ -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