use of org.apache.cxf.jaxrs.impl.HttpServletResponseFilter in project cxf by apache.
the class HttpUtils method createServletResourceValue.
public static <T> T createServletResourceValue(Message m, Class<T> clazz) {
Object value = null;
if (clazz == HttpServletRequest.class) {
HttpServletRequest request = (HttpServletRequest) m.get(AbstractHTTPDestination.HTTP_REQUEST);
value = request != null ? new HttpServletRequestFilter(request, m) : null;
} else if (clazz == HttpServletResponse.class) {
HttpServletResponse response = (HttpServletResponse) m.get(AbstractHTTPDestination.HTTP_RESPONSE);
value = response != null ? new HttpServletResponseFilter(response, m) : null;
} else if (clazz == ServletContext.class) {
value = m.get(AbstractHTTPDestination.HTTP_CONTEXT);
} else if (clazz == ServletConfig.class) {
value = m.get(AbstractHTTPDestination.HTTP_CONFIG);
}
return clazz.cast(value);
}
Aggregations