public void destroyInstance (Object o) throws Exception { if (o==null) return; Servlet servlet = ((Servlet)o); servlet.destroy(); getServletHandler().customizeServletDestroy(servlet); }
private void initServlet(Servlet servlet, ServletConfig config) throws ServletException { Principal user=null; try { //handle any cusomizations of the servlet, such as @postConstruct _servlet = getServletHandler().customizeServlet(servlet); // Handle run as if (_runAs!=null && _realm!=null) user=_realm.pushRole(null,_runAs); servlet.init(config); } catch (Exception e) { throw new ServletException(e); } finally { // pop run-as role if (_runAs!=null && _realm!=null && user!=null) _realm.popRole(user); } }