@SuppressWarnings("unchecked") @Test public void lazyInitWithoutApplicationContext() { assertFalse(LazyInitRegistration.lazyInit(lazyDelegateFilterMock)); verify(lazyDelegateFilterMock, times(0)).setInitHook(Mockito.any(InitHook.class)); verify(lazyDelegateFilterMock, times(0)).lazyInit(); }
static <T extends Filter> boolean lazyInit(LazyDelegateFilter<T> lazyDelegateFilter) { if (APPLICATION_CONTEXT != null) { if (isRegistered(lazyDelegateFilter)) { lazyDelegateFilter.setInitHook(LazyInitRegistration.<T> getInitHook()); lazyDelegateFilter.lazyInit(); REGISTRATION.remove(lazyDelegateFilter); LOGGER.info("lazy initialized {}", lazyDelegateFilter); return true; } else { LOGGER.debug("skipping lazy init for {} because of no init hook registration", lazyDelegateFilter); } } else { LOGGER.debug("skipping lazy init for {} because application context not initialized yet", lazyDelegateFilter); } return false; }
LazyInitRegistration implements ApplicationContextAware { static <T extends Filter> boolean lazyInit(LazyDelegateFilter<T> lazyDelegateFilter) { if (APPLICATION_CONTEXT != null) { if (isRegistered(lazyDelegateFilter)) { lazyDelegateFilter.setInitHook(LazyInitRegistration.<T> getInitHook()); lazyDelegateFilter.lazyInit(); REGISTRATION.remove(lazyDelegateFilter); LOGGER.info("lazy initialized {}", lazyDelegateFilter); return true; } else { LOGGER.debug("skipping lazy init for {} because of no init hook registration", lazyDelegateFilter); } } else { LOGGER.debug("skipping lazy init for {} because application context not initialized yet", lazyDelegateFilter); } return false; } }
LazyInitRegistration implements ApplicationContextAware { static <T extends Filter> boolean lazyInit(LazyDelegateFilter<T> lazyDelegateFilter) { if (APPLICATION_CONTEXT != null) { if (isRegistered(lazyDelegateFilter)) { lazyDelegateFilter.setInitHook(LazyInitRegistration.<T> getInitHook()); lazyDelegateFilter.lazyInit(); REGISTRATION.remove(lazyDelegateFilter); LOGGER.info("lazy initialized {}", lazyDelegateFilter); return true; } else { LOGGER.debug("skipping lazy init for {} because of no init hook registration", lazyDelegateFilter); } } else { LOGGER.debug("skipping lazy init for {} because application context not initialized yet", lazyDelegateFilter); } return false; }  }
LazyInitRegistration implements ApplicationContextAware { static <T extends Filter> boolean lazyInit(LazyDelegateFilter<T> lazyDelegateFilter) { if (APPLICATION_CONTEXT != null) { if (isRegistered(lazyDelegateFilter)) { lazyDelegateFilter.setInitHook(LazyInitRegistration.<T> getInitHook()); lazyDelegateFilter.lazyInit(); REGISTRATION.remove(lazyDelegateFilter); LOGGER.info("lazy initialized {}", lazyDelegateFilter); return true; } else { LOGGER.debug("skipping lazy init for {} because of no init hook registration", lazyDelegateFilter); } } else { LOGGER.debug("skipping lazy init for {} because application context not initialized yet", lazyDelegateFilter); } return false; }  @Override void setApplicationContext(ApplicationContext applicationContext); }
LazyInitRegistration implements ApplicationContextAware { static <T extends Filter> boolean lazyInit(LazyDelegateFilter<T> lazyDelegateFilter) { if (APPLICATION_CONTEXT != null) { if (isRegistered(lazyDelegateFilter)) { lazyDelegateFilter.setInitHook(LazyInitRegistration.<T> getInitHook()); lazyDelegateFilter.lazyInit(); REGISTRATION.remove(lazyDelegateFilter); LOGGER.info("lazy initialized {}", lazyDelegateFilter); return true; } else { LOGGER.debug("skipping lazy init for {} because of no init hook registration", lazyDelegateFilter); } } else { LOGGER.debug("skipping lazy init for {} because application context not initialized yet", lazyDelegateFilter); } return false; }  @Override void setApplicationContext(ApplicationContext applicationContext);  }