com.supermap.services.rest
类 RestServlet
- java.lang.Object
-
- HttpServlet
-
- com.supermap.services.rest.RestServlet
-
- 所有已实现的接口:
- InterfaceContextAware
public class RestServlet extends HttpServlet implements InterfaceContextAware
REST 应用的 Servlet 类,用于以 SCA(服务组件框架)方式发布 REST 服务信息。
-
-
嵌套类概要
嵌套类 限定符和类型 类和说明 class
RestServlet.AdapterProxy
-
构造器概要
构造器 构造器和说明 RestServlet()
-
方法概要
方法 限定符和类型 方法和说明 protected ServletAdapter
createServletAdapter(HttpServletRequest request)
void
destroy()
InterfaceContext
getInterfaceContext()
返回接口上下文。RestServlet.AdapterProxy
getServletAdapter()
void
init(ServletConfig config)
void
service(HttpServletRequest request, HttpServletResponse response)
提供从 URI 到 REST 资源的请求转发处理。void
setInterfaceContext(InterfaceContext context)
设置接口上下文,用于注入接口上下文对象。protected void
setRestApplication(RestApplication restApplication)
设置Rest 应用void
setServletAdapter(RestServlet.AdapterProxy adapter)
-
-
-
方法详细资料
-
init
public void init(ServletConfig config) throws ServletException
- 抛出:
ServletException
-
destroy
public void destroy()
-
service
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
提供从 URI 到 REST 资源的请求转发处理。
- 参数:
request
- 请求对象。response
- 响应对象。- 抛出:
ServletException
- Servlet 异常。java.io.IOException
- 失败或中断的 I/O 操作生成的异常。
-
createServletAdapter
protected ServletAdapter createServletAdapter(HttpServletRequest request) throws java.net.MalformedURLException
- 抛出:
java.net.MalformedURLException
-
getInterfaceContext
public InterfaceContext getInterfaceContext()
返回接口上下文。- 返回:
-
setInterfaceContext
public void setInterfaceContext(InterfaceContext context)
设置接口上下文,用于注入接口上下文对象。
- 指定者:
setInterfaceContext
在接口中InterfaceContextAware
- 参数:
context
- 服务接口上下文接口。
-
getServletAdapter
public RestServlet.AdapterProxy getServletAdapter()
-
setServletAdapter
public void setServletAdapter(RestServlet.AdapterProxy adapter)
-
setRestApplication
protected void setRestApplication(RestApplication restApplication)
设置Rest 应用- 参数:
restApplication
-
-
-