本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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());
}
示例6: setUp
import com.google.appengine.api.modules.ModulesServiceFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
service = ModulesServiceFactory.getModulesService();
}