/** * Destroy all contained filters and servlets. * * @param destroyed * <i>(input/output)</i> the set of filters and servlets which * have already been destroyed within the container context. If * those same instances appear in this pipeline they are not * destroyed a second time. Filters and servlets that are first * destroyed by this pipeline will be added to this set. */ void destroy(final Set<Object> destroyed) { for (Filter ref : filters) destroyFilter(ref, destroyed); destroyServlet(servlet, destroyed); }
/** * Initialize all contained filters and servlets. * * @param context * the servlet container context our {@link MetaServlet} is * running within. * @param inited * <i>(input/output)</i> the set of filters and servlets which * have already been initialized within the container context. If * those same instances appear in this pipeline they are not * initialized a second time. Filters and servlets that are first * initialized by this pipeline will be added to this set. * @throws ServletException * a filter or servlet is unable to initialize. */ void init(final ServletContext context, final Set<Object> inited) throws ServletException { for (Filter ref : filters) initFilter(ref, context, inited); initServlet(servlet, context, inited); }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; UrlPipeline p = find(req); if (p != null) p.service(req, res); else chain.doFilter(req, res); }
public void destroy() { if (pipelines != null) { Set<Object> destroyed = newIdentitySet(); for (UrlPipeline p : pipelines) p.destroy(destroyed); pipelines = null; } }
private UrlPipeline find(HttpServletRequest req) throws ServletException { for (UrlPipeline p : getPipelines()) if (p.match(req)) return p; return null; }
private UrlPipeline[] createPipelines() throws ServletException { UrlPipeline[] array = new UrlPipeline[bindings.size()]; for (int i = 0; i < bindings.size(); i++) array[i] = bindings.get(i).create(); Set<Object> inited = newIdentitySet(); for (UrlPipeline p : array) p.init(servletContext, inited); return array; } }
@Override void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { String curInfo = req.getPathInfo(); String newPath = req.getServletPath() + curInfo; String newInfo = curInfo.substring(0, curInfo.length() - suffixLen); super.service(new WrappedRequest(req, newPath, newInfo), rsp); }
public void destroy() { if (pipelines != null) { Set<Object> destroyed = newIdentitySet(); for (UrlPipeline p : pipelines) p.destroy(destroyed); pipelines = null; } }
private UrlPipeline find(HttpServletRequest req) throws ServletException { for (UrlPipeline p : getPipelines()) if (p.match(req)) return p; return null; }
private UrlPipeline[] createPipelines() throws ServletException { UrlPipeline[] array = new UrlPipeline[bindings.size()]; for (int i = 0; i < bindings.size(); i++) array[i] = bindings.get(i).create(); Set<Object> inited = newIdentitySet(); for (UrlPipeline p : array) p.init(servletContext, inited); return array; } }
/** * Destroy all contained filters and servlets. * * @param destroyed * <i>(input/output)</i> the set of filters and servlets which * have already been destroyed within the container context. If * those same instances appear in this pipeline they are not * destroyed a second time. Filters and servlets that are first * destroyed by this pipeline will be added to this set. */ void destroy(final Set<Object> destroyed) { for (Filter ref : filters) destroyFilter(ref, destroyed); destroyServlet(servlet, destroyed); }
/** * Initialize all contained filters and servlets. * * @param context * the servlet container context our {@link MetaServlet} is * running within. * @param inited * <i>(input/output)</i> the set of filters and servlets which * have already been initialized within the container context. If * those same instances appear in this pipeline they are not * initialized a second time. Filters and servlets that are first * initialized by this pipeline will be added to this set. * @throws ServletException * a filter or servlet is unable to initialize. */ void init(final ServletContext context, final Set<Object> inited) throws ServletException { for (Filter ref : filters) initFilter(ref, context, inited); initServlet(servlet, context, inited); }
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; UrlPipeline p = find(req); if (p != null) p.service(req, res); else chain.doFilter(req, res); }
@Override void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { String curInfo = req.getPathInfo(); String newPath = req.getServletPath() + curInfo; String newInfo = curInfo.substring(0, curInfo.length() - suffixLen); super.service(new WrappedRequest(req, newPath, newInfo), rsp); }