/** Filter initialization. */ public void init(FilterConfig filterConfig) throws ServletException { ServletContext servletContext = filterConfig.getServletContext(); madvoc = Madvoc.get(servletContext); if (madvoc == null) { madvoc = createMadvoc(filterConfig); try { madvoc.startNewWebApplication(servletContext); } catch (Exception ex) { throw new ServletException("Unable to start Madvoc web application.", ex); } } log = LoggerFactory.getLogger(MadvocServletFilter.class); madvocController = madvoc.getMadvocController(); }
/** Filter destruction. */ public void destroy() { madvoc.stopWebApplication(); }
/** * Creates {@link Madvoc Madvoc web application} if not already created. Override it to set custom * {@link MadvocConfig Madvoc configurator} or other core settings. */ protected Madvoc createMadvoc(FilterConfig filterConfig) { Madvoc madvoc = new Madvoc(); madvoc.configure(filterConfig); return madvoc; }