• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ModulesService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.appengine.api.modules.ModulesService的典型用法代码示例。如果您正苦于以下问题:Java ModulesService类的具体用法?Java ModulesService怎么用?Java ModulesService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModulesService类属于com.google.appengine.api.modules包,在下文中一共展示了ModulesService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doFilter

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
@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;
}
 
开发者ID:HotswapProjects,项目名称:HotswapAgentExamples,代码行数:19,代码来源:DevelopersSharedFilter.java


示例2: provideMetricWriter

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
@Provides
static MetricWriter provideMetricWriter(
    Monitoring monitoringClient,
    @Config("projectId") String projectId,
    ModulesService modulesService,
    @Config("stackdriverMaxQps") int maxQps,
    @Config("stackdriverMaxPointsPerRequest") int maxPointsPerRequest) {
  // The MonitoredResource for GAE apps is not writable (and missing fields anyway) so we just
  // use the gce_instance resource type instead.
  return new StackdriverWriter(
      monitoringClient,
      projectId,
      new MonitoredResource()
          .setType("gce_instance")
          .setLabels(
              ImmutableMap.of(
                  // The "zone" field MUST be a valid GCE zone, so we fake one.
                  "zone",
                  SPOOFED_GCE_ZONE,
                  // Overload the GCE "instance_id" field with the GAE module name, version and
                  // instance_id.
                  "instance_id",
                  modulesService.getCurrentModule()
                      + ":"
                      + modulesService.getCurrentVersion()
                      + ":"
                      + modulesService.getCurrentInstanceId())),
      maxQps,
      maxPointsPerRequest);
}
 
开发者ID:google,项目名称:nomulus,代码行数:31,代码来源:StackdriverModule.java


示例3: create

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
public static FakesAndMocksModule create(
    FakeClock clock,
    EppMetric.Builder eppMetricBuilder,
    TmchXmlSignature tmchXmlSignature) {
  FakesAndMocksModule instance = new FakesAndMocksModule();
  instance.clock = clock;
  instance.domainFlowTmchUtils = new DomainFlowTmchUtils(tmchXmlSignature);
  instance.sleeper = new FakeSleeper(clock);
  instance.dnsQueue = DnsQueue.create();
  instance.metricBuilder = eppMetricBuilder;
  instance.modulesService = mock(ModulesService.class);
  instance.metricsEnqueuer = mock(BigQueryMetricsEnqueuer.class);
  instance.lockHandler = new FakeLockHandler(true);
  return instance;
}
 
开发者ID:google,项目名称:nomulus,代码行数:16,代码来源:EppTestComponent.java


示例4: enqueue

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
public void enqueue() {
  // these tasks run on the background thread...
  ModulesService modulesApi = ModulesServiceFactory.getModulesService();
  String hostname = modulesApi.getVersionHostname(ServletConsts.BACKEND_GAE_SERVICE, null);
  task.header(ServletConsts.HOST, hostname);

  Queue queue = QueueFactory.getDefaultQueue();
  queue.add(task);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:10,代码来源:TaskOptionsBuilder.java


示例5: toTaskOptions

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
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;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-pipelines,代码行数:38,代码来源:AppEngineTaskQueue.java


示例6: getAvailableVersions

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
/**
 * Gets all available versions.
 */
public List<Version> getAvailableVersions() {
    ModulesService modulesService = ModulesServiceFactory.getModulesService();
    List<String> versionListInString = new ArrayList<>(modulesService.getVersions(null)); // null == default module
    List<Version> versionList = new ArrayList<>();
    for (String versionInString : versionListInString) {
        versionList.add(new Version(versionInString));
    }
    versionList.sort(null);
    return versionList;
}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:14,代码来源:GaeVersionApi.java


示例7: provideModulesService

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
@Provides
static ModulesService provideModulesService() {
  return modulesService;
}
 
开发者ID:google,项目名称:nomulus,代码行数:5,代码来源:Modules.java


示例8: provideModulesService

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
@Provides
ModulesService provideModulesService() {
  return modulesService;
}
 
开发者ID:google,项目名称:nomulus,代码行数:5,代码来源:EppTestComponent.java


示例9: getZeppaModuleUrl

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
/**
	 * Make a URL pointing to the zeppa-api module to make http request
	 * 
	 * @param methodName
	 *            for the request
	 * @return URL for request
	 * @throws MalformedURLException
	 * @throws UnsupportedEncodingException 
	 */
	public static URL getZeppaModuleUrl(String moduleName, String methodName,
			Map<String, String> params) throws MalformedURLException, UnsupportedEncodingException {

		String paramString = null;

		/*
		 * Append arguments for GET request
		 */
		if (params != null && !params.isEmpty()) {
			StringBuilder paramsBuilder = new StringBuilder();
			paramsBuilder.append("?");
			Set<Entry<String,String>> keySet = params.entrySet();
			Iterator<Entry<String,String>> i = keySet.iterator();
			while (i.hasNext()) {
				Entry<String,String> entry = i.next();
				
				String key = entry.getKey();
				String param = entry.getValue();

				if (paramsBuilder.length() > 1) { //
					paramsBuilder.append("&");
				}
				paramsBuilder.append(key);
				paramsBuilder.append("=");
				
				paramsBuilder.append(param);
			}

			paramString = paramsBuilder.toString();
//			paramString.replaceAll(" ", "%20");
//			paramString = URLEncoder.encode(paramString,"UTF-8");
		}

		ModulesService modulesApi = ModulesServiceFactory.getModulesService();

		URL url = new URL("http://"
				+ modulesApi.getVersionHostname(moduleName, "v1") + "/"
				+ methodName + (paramString == null ? "" : paramString));

		return url;
	}
 
开发者ID:pschuette22,项目名称:Zeppa-AppEngine,代码行数:51,代码来源:ModuleUtils.java


示例10: getCurrentVersion

import com.google.appengine.api.modules.ModulesService; //导入依赖的package包/类
/**
 * Gets the current version of the application.
 */
public Version getCurrentVersion() {
    ModulesService modulesService = ModulesServiceFactory.getModulesService();
    return new Version(modulesService.getCurrentVersion());
}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:8,代码来源:GaeVersionApi.java



注:本文中的com.google.appengine.api.modules.ModulesService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ApplicationIdPBImpl类代码示例发布时间:2022-05-22
下一篇:
Java CassandraTemplate类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap