servicelocator.java
来自「编写rest实例 rest分布式框架在app中的应用」· Java 代码 · 共 29 行
JAVA
29 行
package com.jeffhanson.rest.server;
import java.util.HashMap;
import com.jeffhanson.atompub.service.CollectionService;
public class ServiceLocator
{
private static HashMap<String, BusinessService> services =
new HashMap<String, BusinessService>();
public static BusinessService locateService(String contextRootPath,
String contextPath,
String uri)
throws ServiceLocatorException
{
// TODO locate services mapped to URIs
//
BusinessService service = services.get(uri);
if (service == null)
{
service = new CollectionService(contextRootPath, contextPath);
services.put(uri, service);
}
return service;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?