Files
EWF/library/server/ewsgi/connectors/nino/src/nino_service.e
T
Jocelyn Fiat 8344607eb6 Implemented WSF_RESPONSE.put_error (...) and related
Added WSF_RESPONSE.put_character
Renamed  WGI_OUTPUT_STREAM.put_character_8 as put_character  to follow style of put_string  (and not put_string_8)
Refactored the WSF_DEFAULT_SERVICE_LAUNCHER
Added WSF_DEFAULT_SERVICE to be more user friendly
Splitted the wsf/default/ libraries to have wsf/connector/... and being able to handle more than one connector in the same application
2012-03-20 10:29:55 +01:00

117 lines
2.4 KiB
Plaintext

note
description: "Summary description for {NINO_SERVICE}."
date: "$Date$"
revision: "$Revision$"
class
NINO_SERVICE
create
make,
make_custom,
make_with_callback,
make_custom_with_callback
feature {NONE} -- Implementation
make (a_service: WGI_SERVICE)
-- Initialize `Current'.
do
make_custom (a_service, Void)
end
make_custom (a_service: WGI_SERVICE; a_base_url: detachable STRING)
-- Initialize `Current'.
require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
do
create connector.make_with_base (a_service, a_base_url)
end
make_with_callback (a_callback: like {WGI_AGENT_SERVICE}.callback)
-- Initialize `Current'.
do
make_custom_with_callback (a_callback, Void)
end
make_custom_with_callback (a_callback: like {WGI_AGENT_SERVICE}.callback; a_base_url: detachable STRING)
-- Initialize `Current'.
require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
local
app: WGI_AGENT_SERVICE
do
create app.make (a_callback)
make_custom (app, a_base_url)
end
feature -- Access
connector: WGI_NINO_CONNECTOR
-- Web server connector
feature -- Status report
launched: BOOLEAN
-- Server launched?
do
Result := connector.launched
end
port: INTEGER
-- Port listened
do
Result := connector.port
end
feature -- Status settings
configuration: HTTP_SERVER_CONFIGURATION
do
Result := connector.configuration
end
force_single_threaded
-- Force single threaded behavior
do
configuration.force_single_threaded := True
end
set_is_verbose (b: BOOLEAN)
-- Set verbose message behavior to `b'
do
configuration.set_is_verbose (b)
end
set_base_url (s: detachable READABLE_STRING_8)
-- Set base_url to `s'
do
connector.set_base (s)
end
feature -- Server
listen (a_port: INTEGER)
do
configuration.http_server_port := a_port
connector.launch
end
shutdown
-- Shutdown the server
do
connector.server.shutdown_server
end
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