public class JaxrsServletForJersey extends HttpServlet implements InterfaceContextAware
The Servlet class of JAX-RS standard based REST application, which is used for publishing REST service information by using SCA method.
Modifier and Type | Class and Description |
---|---|
static class |
JaxrsServletForJersey.JerseyServletConfig
The Servlet config class of REST application based on JaX-RS standard.
|
protected static class |
JaxrsServletForJersey.RequestNotCompleteException
Request incomplete exception, which means the current request is just a part of complete request.
|
protected static class |
JaxrsServletForJersey.RequestWrapper
HTTP request handling class, which is used to transform the URI path.
|
Constructor and Description |
---|
JaxrsServletForJersey()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected JaxrsServletForJersey.RequestWrapper |
createRequestWrapper(HttpServletRequest request)
Creates request object handle class, to generate the request object corresponding to the Servlet.
|
void |
destroy()
Destroys object.
|
java.lang.String |
getId() |
InterfaceContext |
getInterfaceContext()
Gets the service interface context.
|
protected java.lang.String |
getJaxrsApplicationName()
Gets the Jaxts application name.
|
protected ServletContainer |
getServletContainer()
Gets the Servlet container.
|
protected java.lang.String |
getURLQueryParamValue(HttpServletRequest request, java.lang.String paramName)
Gets the specified query parameter in the request url, if there is parameters with the same name, the return value will use "%_" to separate the parameters.
|
JaxrsServletForJersey.JerseyServletConfig |
newJerseyServletConfig(ServletConfig servletConfig) |
void |
service(HttpServletRequest request, HttpServletResponse response)
Provides the request forward processing from URI to REST resource.
|
void |
setInterfaceContext(InterfaceContext interfaceContext)
Sets the service interface context to inject interface context object.
|
void |
setJaxrsApplication(javax.ws.rs.core.Application value) |
void |
setJaxrsApplicationClass(java.lang.Class<? extends javax.ws.rs.core.Application> clz)
Sets the Jaxts application class.
|
void |
setJaxrsApplicationName(java.lang.String value)
Sets the Jaxts application name.
|
protected void |
setMockRequestEntity(JaxrsServletForJersey.RequestWrapper request)
Sets the mocked request body.
|
public InterfaceContext getInterfaceContext()
Gets the service interface context.
public void setInterfaceContext(InterfaceContext interfaceContext)
Sets the service interface context to inject interface context object.
setInterfaceContext
in interface InterfaceContextAware
interfaceContext
- The service interface context interface.public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
Provides the request forward processing from URI to REST resource.
request
- The request object.response
- The response object.ServletException
- Servlet exception.java.io.IOException
- Exception generated by I/O operation failure or break.public void destroy()
Destroys object.
protected JaxrsServletForJersey.RequestWrapper createRequestWrapper(HttpServletRequest request) throws JaxrsServletForJersey.RequestNotCompleteException
Creates request object handle class, to generate the request object corresponding to the Servlet.
request
- The request object.JaxrsServletForJersey.RequestNotCompleteException
- Request incomplete exception.protected void setMockRequestEntity(JaxrsServletForJersey.RequestWrapper request) throws JaxrsServletForJersey.RequestNotCompleteException
request
-JaxrsServletForJersey.RequestNotCompleteException
protected java.lang.String getURLQueryParamValue(HttpServletRequest request, java.lang.String paramName)
protected ServletContainer getServletContainer()
Gets the Servlet container.
protected java.lang.String getJaxrsApplicationName()
Gets the Jaxts application name.
public void setJaxrsApplicationName(java.lang.String value)
Sets the Jaxts application name.
value
-public void setJaxrsApplication(javax.ws.rs.core.Application value)
public void setJaxrsApplicationClass(java.lang.Class<? extends javax.ws.rs.core.Application> clz)
Sets the Jaxts application class. It is equivalent to call etJaxrsApplicationName(clz.getName()).
clz
-public JaxrsServletForJersey.JerseyServletConfig newJerseyServletConfig(ServletConfig servletConfig)
public java.lang.String getId()