Example #1
0
  /** 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();
  }
Example #2
0
 /** Filter destruction. */
 public void destroy() {
   madvoc.stopWebApplication();
 }
Example #3
0
 /**
  * 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;
 }