com.supermap.services.rest
Class RestServlet
- java.lang.Object
-
- HttpServlet
-
- com.supermap.services.rest.RestServlet
-
- All Implemented Interfaces:
- InterfaceContextAware
public class RestServlet extends HttpServlet implements InterfaceContextAware
REST application of the Servlet class, is used to SCA (service component framework) way to publish REST service information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classRestServlet.AdapterProxy
-
Constructor Summary
Constructors Constructor and Description RestServlet()
-
Method Summary
Methods Modifier and Type Method and Description protected ServletAdaptercreateServletAdapter(HttpServletRequest request)InterfaceContextgetInterfaceContext()Returns the interface context.RestServlet.AdapterProxygetServletAdapter()voidinit(ServletConfig config)voidservice(HttpServletRequest request, HttpServletResponse response)Provides request forwarding from URI to REST resources.voidsetInterfaceContext(InterfaceContext context)Sets the interface context for injecting interface context objects.protected voidsetRestApplication(RestApplication restApplication)Sets the Rest applicationvoidsetServletAdapter(RestServlet.AdapterProxy adapter)
-
-
-
Method Detail
-
init
public void init(ServletConfig config) throws ServletException- Throws:
ServletException
-
service
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionProvides request forwarding from URI to REST resources.
- Parameters:
request- request object.response- response object.- Throws:
ServletException- Servlet exception.java.io.IOException- An exception caused by a failed or interrupted I/O operation.
-
createServletAdapter
protected ServletAdapter createServletAdapter(HttpServletRequest request) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
getInterfaceContext
public InterfaceContext getInterfaceContext()
Returns the interface context.- Returns:
-
setInterfaceContext
public void setInterfaceContext(InterfaceContext context)
Sets the interface context for injecting interface context objects.
- Specified by:
setInterfaceContextin interfaceInterfaceContextAware- Parameters:
context- service interface context interface.
-
getServletAdapter
public RestServlet.AdapterProxy getServletAdapter()
-
setServletAdapter
public void setServletAdapter(RestServlet.AdapterProxy adapter)
-
setRestApplication
protected void setRestApplication(RestApplication restApplication)
Sets the Rest application- Parameters:
restApplication-
-
-