public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
      throws IOException, ServletException {
    HttpServletRequest request = (HttpServletRequest) req;
    HttpServletResponse response = (HttpServletResponse) res;

    if (!enabled || !requiresProcessing(request, response)) {
      chain.doFilter(request, response);
      return;
    }

    if (singleSignOutHandler.process(request, response)) {
      chain.doFilter(req, res);
    }
  }
 @Override
 public void afterPropertiesSet() throws ServletException {
   Assert.hasLength(filterProcessesUrl, "filterProcessesUrl must be specified");
   Assert.notNull(singleSignOutHandler, "singleSignOutHandler cannot be null");
   singleSignOutHandler.init();
 }