@ Nonnull public EChange addListener ( @ Nonnull final EventListener aListener ) { ValueEnforcer . notNull ( aListener , "Listener" ) ; // Small consistency check if ( ! ( aListener instanceof ServletContextListener ) && ! ( aListener instanceof HttpSessionListener ) && ! ( aListener instanceof ServletRequestListener ) ) { LOGGER . warn ( "Passed mock listener is none of ServletContextListener, HttpSessionListener or ServletRequestListener and therefore has no effect. The listener class is: " + aListener . getClass ( ) ) ; } return m_aRWLock . writeLocked ( ( ) -> EChange . valueOf ( m_aListener . add ( aListener ) ) ) ; }
Add a new listener .