From 1e6d27325436f0718694a5aa1fad6cacc7c6e156 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 20 Dec 2012 10:09:49 +0100 Subject: [PATCH] Added openshift connector classes (for experimentation) --- .../server/wsf/connector/openshift-safe.ecf | 18 ++++ .../wsf_openshift_service_launcher.e | 83 +++++++++++++++++++ library/server/wsf/default/openshift-safe.ecf | 16 ++++ .../openshift/wsf_default_response_service.e | 24 ++++++ .../default/openshift/wsf_default_service.e | 22 +++++ .../openshift/wsf_default_service_launcher.e | 31 +++++++ 6 files changed, 194 insertions(+) create mode 100644 library/server/wsf/connector/openshift-safe.ecf create mode 100644 library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e create mode 100644 library/server/wsf/default/openshift-safe.ecf create mode 100644 library/server/wsf/default/openshift/wsf_default_response_service.e create mode 100644 library/server/wsf/default/openshift/wsf_default_service.e create mode 100644 library/server/wsf/default/openshift/wsf_default_service_launcher.e diff --git a/library/server/wsf/connector/openshift-safe.ecf b/library/server/wsf/connector/openshift-safe.ecf new file mode 100644 index 00000000..50e1a697 --- /dev/null +++ b/library/server/wsf/connector/openshift-safe.ecf @@ -0,0 +1,18 @@ + + + + + + /EIFGENs$ + /\.git$ + /\.svn$ + + + + + + + + + diff --git a/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e b/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e new file mode 100644 index 00000000..507f34d3 --- /dev/null +++ b/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e @@ -0,0 +1,83 @@ +note + description: "[ + Component to launch the service using the default connector + + Eiffel Web Nino customized for OpenShift + + + This default connector support options: + base: base_url (very specific to standalone server) + verbose: to display verbose output, useful for Nino + force_single_threaded: use only one thread, useful for Nino + + check WSF_SERVICE_LAUNCHER for more documentation + ]" + date: "$Date$" + revision: "$Revision$" + +class + WSF_OPENSHIFT_SERVICE_LAUNCHER + +inherit + WSF_NINO_SERVICE_LAUNCHER + redefine + initialize + end + +create + make, + make_and_launch, + make_callback, + make_callback_and_launch + +feature {NONE} -- Initialization + + initialize + local + l_env: EXECUTION_ENVIRONMENT + do + Precursor + create l_env + if attached l_env.get (Openshift_port) as l_port then + if l_port.is_integer then + port_number := l_port.to_integer + else + die ("could not parse " + Openshift_port) + end + else + die (Openshift_port + " is not defined") + end + end + +feature {NONE} -- Implementation + + die (a_message: STRING) + -- Die with `a_message'. + local + l_exceptions: EXCEPTIONS + do + io.put_string (a_message) + io.put_new_line + create l_exceptions + l_exceptions.die (1) + end + + Openshift_ip: STRING = "OPENSHIFT_INTERNAL_IP" + -- OpenShift IP environment variable name + + Openshift_port: STRING = "OPENSHIFT_INTERNAL_PORT" + -- OpenShift port environment variable name + + +;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 diff --git a/library/server/wsf/default/openshift-safe.ecf b/library/server/wsf/default/openshift-safe.ecf new file mode 100644 index 00000000..1f5a6c95 --- /dev/null +++ b/library/server/wsf/default/openshift-safe.ecf @@ -0,0 +1,16 @@ + + + + + + /EIFGENs$ + /\.git$ + /\.svn$ + + + diff --git a/library/server/wsf/default/openshift/wsf_default_response_service.e b/library/server/wsf/default/openshift/wsf_default_response_service.e new file mode 100644 index 00000000..0cefc7da --- /dev/null +++ b/library/server/wsf/default/openshift/wsf_default_response_service.e @@ -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 diff --git a/library/server/wsf/default/openshift/wsf_default_service.e b/library/server/wsf/default/openshift/wsf_default_service.e new file mode 100644 index 00000000..dd76ca78 --- /dev/null +++ b/library/server/wsf/default/openshift/wsf_default_service.e @@ -0,0 +1,22 @@ +note + description: "Summary description for {WSF_DEFAULT_SERVICE}." + date: "$Date$" + revision: "$Revision$" + +deferred class + WSF_DEFAULT_SERVICE + +inherit + WSF_DEFAULT_SERVICE_I [WSF_DEFAULT_SERVICE_LAUNCHER] + +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 diff --git a/library/server/wsf/default/openshift/wsf_default_service_launcher.e b/library/server/wsf/default/openshift/wsf_default_service_launcher.e new file mode 100644 index 00000000..a648940a --- /dev/null +++ b/library/server/wsf/default/openshift/wsf_default_service_launcher.e @@ -0,0 +1,31 @@ +note + description: "[ + Default launcher for WSF_SERVICE based on {WSF_OPENSHIFT_SERVICE_LAUNCHER} + ]" + date: "$Date$" + revision: "$Revision$" + +class + WSF_DEFAULT_SERVICE_LAUNCHER + +inherit + WSF_OPENSHIFT_SERVICE_LAUNCHER + +create + make, + make_and_launch, + make_callback, + make_callback_and_launch + +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