Added abstraction WSF_ROUTED, and WSF_FILTERED.
Added under library/server/obsolete/v0 the previous non concurrent friendly version of EWF/WSF, for backward compatiblity. Removed WSF_CALLBACK_SERVICE and WSF_TO_WGI_SERVICE which are not need with new EWF.
This commit is contained in:
63
library/server/wsf/router/filter/wsf_filtered.e
Normal file
63
library/server/wsf/router/filter/wsf_filtered.e
Normal file
@@ -0,0 +1,63 @@
|
||||
note
|
||||
description: "Object with a `filter: WSF_FILTER' feature."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_FILTERED
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize_filter
|
||||
-- Initialize `filter'
|
||||
do
|
||||
create_filter
|
||||
setup_filter
|
||||
end
|
||||
|
||||
create_filter
|
||||
-- Create `filter'
|
||||
deferred
|
||||
ensure
|
||||
filter_created: filter /= Void
|
||||
end
|
||||
|
||||
setup_filter
|
||||
-- Setup `filter'
|
||||
require
|
||||
filter_created: filter /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
append_filters (a_filters: ITERABLE [WSF_FILTER])
|
||||
-- Append collection `a_filters' of filters to the end of the `filter' chain.
|
||||
local
|
||||
f: like filter
|
||||
l_next_filter: detachable like filter
|
||||
do
|
||||
from
|
||||
f := filter
|
||||
l_next_filter := f.next
|
||||
until
|
||||
l_next_filter = Void
|
||||
loop
|
||||
f := l_next_filter
|
||||
l_next_filter := f.next
|
||||
end
|
||||
check f_attached_without_next: f /= Void and then f.next = Void end
|
||||
across
|
||||
a_filters as ic
|
||||
loop
|
||||
l_next_filter := ic.item
|
||||
f.set_next (l_next_filter)
|
||||
f := l_next_filter
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
filter: WSF_FILTER
|
||||
-- Filter
|
||||
|
||||
|
||||
end
|
||||
@@ -13,6 +13,8 @@ inherit
|
||||
initialize
|
||||
end
|
||||
|
||||
WSF_FILTERED
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
@@ -21,57 +23,6 @@ feature {NONE} -- Initialization
|
||||
initialize_filter
|
||||
end
|
||||
|
||||
initialize_filter
|
||||
-- Initialize `filter'
|
||||
do
|
||||
create_filter
|
||||
setup_filter
|
||||
end
|
||||
|
||||
create_filter
|
||||
-- Create `filter'
|
||||
deferred
|
||||
ensure
|
||||
filter_created: filter /= Void
|
||||
end
|
||||
|
||||
setup_filter
|
||||
-- Setup `filter'
|
||||
require
|
||||
filter_created: filter /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
append_filters (a_filters: ITERABLE [WSF_FILTER])
|
||||
-- Append collection `a_filters' of filters to the end of the `filter' chain.
|
||||
local
|
||||
f: like filter
|
||||
l_next_filter: detachable like filter
|
||||
do
|
||||
from
|
||||
f := filter
|
||||
l_next_filter := f.next
|
||||
until
|
||||
l_next_filter = Void
|
||||
loop
|
||||
f := l_next_filter
|
||||
l_next_filter := f.next
|
||||
end
|
||||
check f_attached_without_next: f /= Void and then f.next = Void end
|
||||
across
|
||||
a_filters as ic
|
||||
loop
|
||||
l_next_filter := ic.item
|
||||
f.set_next (l_next_filter)
|
||||
f := l_next_filter
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
filter: WSF_FILTER
|
||||
-- Filter
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
note
|
||||
description: "Facilities inheritance to add URI base routing to a routed execution"
|
||||
description: "Facilities inheritance to add URI base routing to a routed object."
|
||||
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class WSF_URI_HELPER_FOR_ROUTED_EXECUTION
|
||||
deferred class WSF_ROUTED_URI_HELPER
|
||||
|
||||
feature -- Access
|
||||
|
||||
router: WSF_ROUTER
|
||||
-- Router used to dispatch the request according to the WSF_REQUEST object
|
||||
-- and associated request methods;
|
||||
-- This should not be implemented by descendants. Instead, you gain an effective
|
||||
-- version by also inheriting from WSF_ROUTED_EXECUTION, or one of it's descendants.
|
||||
deferred
|
||||
ensure
|
||||
router_not_void: Result /= Void
|
||||
end
|
||||
inherit
|
||||
WSF_ROUTED
|
||||
|
||||
feature -- Mapping helper: uri
|
||||
|
||||
@@ -47,7 +38,7 @@ feature -- Mapping helper: uri agent
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||
@@ -1,23 +1,13 @@
|
||||
note
|
||||
description: "Facilities inheritance to add URI template-base routing to a routed execution"
|
||||
author: ""
|
||||
description: "Facilities inheritance to add URI template-base routing to a routed object."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
|
||||
WSF_ROUTED_URI_TEMPLATE_HELPER
|
||||
|
||||
feature -- Access
|
||||
|
||||
router: WSF_ROUTER
|
||||
-- Router used to dispatch the request according to the WSF_REQUEST object
|
||||
-- and associated request methods;
|
||||
-- This should not be implemented by descendants. Instead, you gain an effective
|
||||
-- version by also inheriting from WSF_ROUTED_SERVICE, or one of it's descendants.
|
||||
deferred
|
||||
ensure
|
||||
router_not_void: Result /= Void
|
||||
end
|
||||
inherit
|
||||
WSF_ROUTED
|
||||
|
||||
feature -- Mapping helper: uri template
|
||||
|
||||
@@ -60,7 +50,7 @@ feature -- Mapping helper: uri template agent
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||
31
library/server/wsf/router/wsf_routed.e
Normal file
31
library/server/wsf/router/wsf_routed.e
Normal file
@@ -0,0 +1,31 @@
|
||||
note
|
||||
description: "Object with a `router' feature, used to dispatch url."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_ROUTED
|
||||
|
||||
feature -- Access
|
||||
|
||||
router: WSF_ROUTER
|
||||
-- Router used to dispatch the request according to the WSF_REQUEST object
|
||||
-- and associated request methods;
|
||||
-- This should not be implemented by descendants. Instead, you gain an effective
|
||||
-- version by also inheriting from WSF_ROUTED_EXECUTION, or one of it's descendants.
|
||||
deferred
|
||||
ensure
|
||||
router_not_void: Result /= Void
|
||||
end
|
||||
|
||||
note
|
||||
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
|
||||
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
|
||||
@@ -12,6 +12,8 @@ inherit
|
||||
initialize
|
||||
end
|
||||
|
||||
WSF_ROUTED
|
||||
|
||||
feature {NONE} -- Initialize
|
||||
|
||||
initialize
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Create this service with a callback to implement {WSF_SERVICE}.execute (req, res)
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_CALLBACK_SERVICE
|
||||
|
||||
inherit
|
||||
WSF_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
convert
|
||||
make ({PROCEDURE [ANY, TUPLE [WSF_REQUEST, WSF_RESPONSE]]})
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
make (a_callback: like callback)
|
||||
-- Initialize `Current'.
|
||||
do
|
||||
callback := a_callback
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
callback: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]
|
||||
-- Procedure called on `execute'
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute the request
|
||||
do
|
||||
callback.call ([req, res])
|
||||
end
|
||||
|
||||
invariant
|
||||
callback_attached: callback /= Void
|
||||
|
||||
note
|
||||
copyright: "2011-2012, 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
|
||||
@@ -23,9 +23,15 @@ feature {NONE} -- Initialization
|
||||
do
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
service_options: detachable WSF_SERVICE_LAUNCHER_OPTIONS
|
||||
-- Optional service options used to configure associated WSF_SERVICE_LAUNCHER.
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
-- Launch service with optional options `opts'.
|
||||
deferred
|
||||
end
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
This class is the link between WGI_SERVICE and WSF_SERVICE
|
||||
It makes a WSF_SERVICE callable from the WGI_ world.
|
||||
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_TO_WGI_SERVICE
|
||||
|
||||
inherit
|
||||
WGI_SERVICE
|
||||
|
||||
note
|
||||
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
|
||||
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
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-12-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-12-0 http://www.eiffel.com/developers/xml/configuration-1-12-0.xsd" name="wsf" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="wsf" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
|
||||
<target name="wsf">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
@@ -9,6 +9,8 @@
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
||||
</option>
|
||||
<mapping old_name="WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION" new_name="WSF_ROUTED_URI_TEMPLATE_HELPER"/>
|
||||
<mapping old_name="WSF_URI_HELPER_FOR_ROUTED_EXECUTION" new_name="WSF_ROUTED_URI_HELPER"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
|
||||
<library name="conneg" location="..\..\network\protocol\content_negotiation\conneg-safe.ecf"/>
|
||||
|
||||
Reference in New Issue
Block a user