Пример #1
0
    def __init__(self, request_data, runtime_config_getter,
                 module_configuration):
        """Initializer for GoRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      module_configuration: An application_configuration.ModuleConfiguration
          instance respresenting the configuration of the module that owns the
          runtime.
    """
        super(GoRuntimeInstanceFactory, self).__init__(request_data, 8, 10)
        self._runtime_config_getter = runtime_config_getter
        self._module_configuration = module_configuration
        self._application_lock = threading.Lock()
        if (module_configuration.runtime == 'vm'
                or util.is_env_flex(module_configuration.env)):
            self._start_process_flavor = http_runtime.START_PROCESS_REVERSE
            self._go_application = go_managedvm.GoManagedVMApp(
                self._module_configuration)
        else:
            self._start_process_flavor = http_runtime.START_PROCESS
            self._go_application = go_application.GoApplication(
                self._module_configuration,
                runtime_config_getter().go_config.work_dir)
        self._modified_since_last_build = False
        self._last_build_error = None
  def __init__(self, request_data, runtime_config_getter, module_configuration):
    """Initializer for GoRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      module_configuration: An application_configuration.ModuleConfiguration
          instance respresenting the configuration of the module that owns the
          runtime.
    """
    super(GoRuntimeInstanceFactory, self).__init__(request_data, 1)
    self._runtime_config_getter = runtime_config_getter
    self._module_configuration = module_configuration
    self._application_lock = threading.Lock()
    if (module_configuration.runtime == 'vm' or
        util.is_env_flex(module_configuration.env)):
      self._start_process_flavor = http_runtime.START_PROCESS_REVERSE
      self._go_application = go_managedvm.GoManagedVMApp(
          self._module_configuration)
    else:
      self._start_process_flavor = http_runtime.START_PROCESS
      self._go_application = go_application.GoApplication(
          self._module_configuration)
    self._modified_since_last_build = False
    self._last_build_error = None
Пример #3
0
  def __init__(self, request_data, runtime_config_getter, module_configuration):
    """Initializer for JavaRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      module_configuration: An application_configuration.ModuleConfiguration
          instance representing the configuration of the module that owns the
          runtime.
    """
    super(JavaRuntimeInstanceFactory, self).__init__(request_data, 1)
    self._runtime_config_getter = runtime_config_getter
    self._module_configuration = module_configuration
    self._application_lock = threading.Lock()
    self._application = application.JavaApplication(
        self._module_configuration)
    self._for_jetty9 = (module_configuration.runtime == 'vm' or
                        util.is_env_flex(module_configuration.env))
    self._java_command = self._make_java_command()
Пример #4
0
    def __init__(self, request_data, runtime_config_getter,
                 module_configuration):
        """Initializer for JavaRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      module_configuration: An application_configuration.ModuleConfiguration
          instance representing the configuration of the module that owns the
          runtime.
    """
        super(JavaRuntimeInstanceFactory, self).__init__(request_data, 1)
        self._runtime_config_getter = runtime_config_getter
        self._module_configuration = module_configuration
        self._application_lock = threading.Lock()
        self._application = application.JavaApplication(
            self._module_configuration)
        self._for_jetty9 = (module_configuration.runtime == 'vm'
                            or util.is_env_flex(module_configuration.env))
        self._java_command = self._make_java_command()