当前位置: 首页>>代码示例>>Java>>正文


Java ModulesServiceFactory.getModulesService方法代码示例

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


在下文中一共展示了ModulesServiceFactory.getModulesService方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doFilter

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的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: enqueue

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的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

示例3: getAvailableVersions

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的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

示例4: getZeppaModuleUrl

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的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

示例5: getCurrentVersion

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的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

示例6: setUp

import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
    service = ModulesServiceFactory.getModulesService();
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:5,代码来源:ModulesServiceTest.java


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