@Override public void contextDestroyed(ServletContextEvent sce) { super.contextDestroyed(sce); }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); dispatcher.service(request, response); } }
@Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); servletContext.setInitParameter("resteasy.injector.factory", RestfulInjectorFactory.class.getName()); servletContext.setInitParameter(ResteasyContextParameters.RESTEASY_PROVIDERS, RpcExceptionMapper.class.getName()); super.contextInitialized(sce); ServletRestServer.setResteasyDeployment(deployment); }
public Dispatcher getDispatcher() { return servletContainerDispatcher.getDispatcher(); }
@Override protected HttpRequest createHttpRequest(String httpMethod, HttpServletRequest httpServletRequest, ResteasyHttpHeaders httpHeaders, ResteasyUriInfo uriInfo, HttpResponse httpResponse, HttpServletResponse httpServletResponse) { Servlet3AsyncHttpRequest request = new Servlet3AsyncHttpRequest(httpServletRequest, httpServletResponse, getServletContext(), httpResponse, httpHeaders, uriInfo, httpMethod.toUpperCase(), (SynchronousDispatcher) getDispatcher()); request.asyncScheduler = asyncCancelScheduler; return request; }
@Override protected void doStart(URL url) { // TODO jetty will by default enable keepAlive so the xml config has no effect now httpServer = httpBinder.bind(url, new RestHandler()); ServletContext servletContext = ServletManager.getInstance().getServletContext(url.getPort()); if (servletContext == null) { servletContext = ServletManager.getInstance().getServletContext(ServletManager.EXTERNAL_SERVER_PORT); } if (servletContext == null) { throw new RpcException("No servlet context found. If you are using server='servlet', " + "make sure that you've configured " + BootstrapListener.class.getName() + " in web.xml"); } servletContext.setAttribute(ResteasyDeployment.class.getName(), deployment); try { dispatcher.init(new SimpleServletConfig(servletContext)); } catch (ServletException e) { throw new RpcException(e); } }
@Override public HttpRequest createResteasyHttpRequest(String httpMethod, HttpServletRequest httpServletRequest, ResteasyHttpHeaders httpHeaders, ResteasyUriInfo uriInfo, HttpResponse httpResponse, HttpServletResponse httpServletResponse) { Servlet3AsyncHttpRequest request = new Servlet3AsyncHttpRequest(httpServletRequest, httpServletResponse, servletContext, httpResponse, httpHeaders, uriInfo, httpMethod, (SynchronousDispatcher) getDispatcher()); request.asyncScheduler = asyncCancelScheduler; return request; }
@Override public void addAll(String key, Object... newValues) { for (Object value : newValues) { add(key, value); } }
@Override public ResteasyAsynchronousResponse suspend(long millis) throws IllegalStateException { return suspend(millis, TimeUnit.MILLISECONDS); }
@Override public Set<String> getInitParameterNames() { return getParameterNames(); }
public Servlet3AsyncHttpRequest(final HttpServletRequest httpServletRequest, final HttpServletResponse response, final ServletContext servletContext, final HttpResponse httpResponse, final ResteasyHttpHeaders httpHeaders, final ResteasyUriInfo uriInfo, final String s, final SynchronousDispatcher synchronousDispatcher) { super(httpServletRequest, response, servletContext, httpResponse, httpHeaders, uriInfo, s, synchronousDispatcher); this.response = response; asynchronousContext = new Servlet3ExecutionContext((ServletRequest) httpServletRequest); }
public HttpServletResponseWrapper(final HttpServletResponse response, final ResteasyProviderFactory factory) { this.response = response; outputHeaders = new HttpServletResponseHeaders(response, factory); this.factory = factory; }
public HttpRequest createResteasyHttpRequest(String httpMethod, HttpServletRequest request, ResteasyHttpHeaders headers, ResteasyUriInfo uriInfo, HttpResponse theResponse, HttpServletResponse response) { return createHttpRequest(httpMethod, request, headers, uriInfo, theResponse, response); }
public HttpResponse createResteasyHttpResponse(HttpServletResponse response) { return createServletResponse(response); }
@Override public Set<String> getParameterNames() { return getServletContextNames(); }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); dispatcher.service(request, response); } }
Registry registry = (Registry) context.getAttribute(Registry.class.getName()); if (registry == null) { registry = servletContainerDispatcher.getDispatcher().getRegistry();
@Override protected void doStart(URL url) { // TODO jetty will by default enable keepAlive so the xml config has no effect now httpServer = httpBinder.bind(url, new RestHandler()); ServletContext servletContext = ServletManager.getInstance().getServletContext(url.getPort()); if (servletContext == null) { servletContext = ServletManager.getInstance().getServletContext(ServletManager.EXTERNAL_SERVER_PORT); } if (servletContext == null) { throw new RpcException("No servlet context found. If you are using server='servlet', " + "make sure that you've configured " + BootstrapListener.class.getName() + " in web.xml"); } servletContext.setAttribute(ResteasyDeployment.class.getName(), deployment); try { dispatcher.init(new SimpleServletConfig(servletContext)); } catch (ServletException e) { throw new RpcException(e); } }
@Override public void addAll(String key, List<Object> valueList) { for (Object value : valueList) { add(key, value); } }
@Override public ResteasyAsynchronousResponse suspend() throws IllegalStateException { return suspend(-1); }