Package com.google.appengine.api.modules

Examples of com.google.appengine.api.modules.ModulesService


    } else {

      String versionHostname = RetryHelper.runWithRetries(new Callable<String>() {
        @Override
        public String call() {
          ModulesService service = ModulesServiceFactory.getModulesService();
          String module = queueSettings.getOnModule();
          String version = queueSettings.getModuleVersion();
          if (module == null) {
            module = service.getCurrentModule();
            version = service.getCurrentVersion();
          }
          return service.getVersionHostname(module, version);
        }
      }, RetryParams.getDefaultInstance(), MODULES_EXCEPTION_HANDLER);
      taskOptions.header("Host", versionHostname);
    }
View Full Code Here


        String currentBackend = backendSerivce.getCurrentBackend();
        // If currentBackend contains ':' it is actually a B type module (see b/12893879)
        if (currentBackend != null && currentBackend.indexOf(':') == -1) {
          queueSettings.setOnBackend(currentBackend);
        } else {
          ModulesService modulesService = ModulesServiceFactory.getModulesService();
          queueSettings.setOnModule(modulesService.getCurrentModule());
          queueSettings.setModuleVersion(modulesService.getCurrentVersion());
        }
      } else {
        ModulesService modulesService = ModulesServiceFactory.getModulesService();
        if (module.equals(modulesService.getCurrentModule())) {
          queueSettings.setModuleVersion(modulesService.getCurrentVersion());
        } else {
          queueSettings.setModuleVersion(modulesService.getDefaultVersion(module));
        }
      }
    }
  }
View Full Code Here

          getHeaderOrParameter(hrequest, BackendService.REQUEST_HEADER_BACKEND_REDIRECT);
    }

    boolean isLoadBalancingModuleInstance = false;
    if (moduleOrBackendName == null) {
      ModulesService modulesService = ModulesServiceFactory.getModulesService();
      moduleOrBackendName = modulesService.getCurrentModule();
      isLoadBalancingModuleInstance = true;
    }
    ModulesFilterHelper modulesFilterHelper = getModulesFilterHelper();
    int instance = getInstanceIdFromRequest(hrequest);
    logger.finest(String.format("redirect request to module: %d.%s", instance,
View Full Code Here

        String currentBackend = backendService.getCurrentBackend();
        // If currentBackend contains ':' it is actually a B type module (see b/12893879)
        if (currentBackend != null && currentBackend.indexOf(':') == -1) {
          backend = currentBackend;
        } else {
          ModulesService modulesService = ModulesServiceFactory.getModulesService();
          module = modulesService.getCurrentModule();
          version = modulesService.getCurrentVersion();
        }
      } else {
        final ModulesService modulesService = ModulesServiceFactory.getModulesService();
        if (module.equals(modulesService.getCurrentModule())) {
          version = modulesService.getCurrentVersion();
        } else {
          // TODO(user): we may want to support providing a version for a module
          final String requestedModule = module;
          version = runWithRetries(new Callable<String>() {
            @Override public String call() {
              return modulesService.getDefaultVersion(requestedModule);
            }
          },  QUEUE_RETRY_PARAMS, MODULES_EXCEPTION_HANDLER);
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.modules.ModulesService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.