com.google.appengine.api.modules.ModulesServiceFactory Java Examples
The following examples show how to use
com.google.appengine.api.modules.ModulesServiceFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DevelopersSharedFilter.java From HotswapAgentExamples with GNU General Public License v2.0 | 6 votes |
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { ModulesService modulesApi = ModulesServiceFactory.getModulesService(); String instanceHostname = modulesApi.getCurrentInstanceId() + "." + modulesApi.getCurrentVersion() + "." + modulesApi.getCurrentModule(); Logger logger = LoggerFactory.getLogger(instanceHostname); logger.info(logger.getName()); logger.info("begin guice filter"); super.doFilter(servletRequest, servletResponse, filterChain); logger.info("end guice filter"); return; }
Example #2
Source File: AppEngineTaskQueue.java From appengine-pipelines with Apache License 2.0 | 5 votes |
private TaskOptions toTaskOptions(Task task) { final QueueSettings queueSettings = task.getQueueSettings(); TaskOptions taskOptions = TaskOptions.Builder.withUrl(TaskHandler.handleTaskUrl()); if (queueSettings.getOnBackend() != null) { taskOptions.header("Host", BackendServiceFactory.getBackendService().getBackendAddress( queueSettings.getOnBackend())); } 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); } Long delayInSeconds = queueSettings.getDelayInSeconds(); if (null != delayInSeconds) { taskOptions.countdownMillis(delayInSeconds * 1000L); queueSettings.setDelayInSeconds(null); } addProperties(taskOptions, task.toProperties()); String taskName = task.getName(); if (null != taskName) { taskOptions.taskName(taskName); } return taskOptions; }
Example #3
Source File: UtilsModule.java From nomulus with Apache License 2.0 | 4 votes |
@Provides @Singleton static ModulesService provideModulesService() { return ModulesServiceFactory.getModulesService(); }
Example #4
Source File: ModulesServiceTest.java From appengine-tck with Apache License 2.0 | 4 votes |
@Before public void setUp() { service = ModulesServiceFactory.getModulesService(); }