/* * The wrapped object expects to get this message now, but we delay it until * we receive the right FrameworkEvent. * * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ public void init(FilterConfig filterConfig) throws ServletException { delayedConfig = filterConfig; if (hasBeenActivated) { // no point in delaying, everybody is already ready delayed.init(filterConfig); // we are also now in the ready state because no sense in waiting ready = true; } }
/* * Do the work that should have happened init time. This also "turns on" the * filter so future calls pass directly through this class to the wrapped * filter. */ public void frameworkEvent(FrameworkEvent event) { if (event.getType() != FrameworkEvent.STARTED) { return; } try { delayed.init(delayedConfig); ready = true; } catch (ServletException e) { log.error(e); } }