public class PentahoLoggerListener extends Object implements org.springframework.context.ApplicationListener
But when the OrderedApplicationEventMulticaster multicasts a ApplicationEvent to all listeners
( read: ApplicationListener interface ), it does so without checking if that particular ApplicationListener instance
does in fact support the ApplicationEvent instance
listener.onApplicationEvent( event )
and in cases such as a 'PublicInvocationEvent' or a 'ContextRefreshedEvent' are sent, the LoggerListener ended up
throwing a ClassCastException: event cannot be cast to AbstractAuthenticationEvent and actually halting
the operation at hand
We are instantiating org.springframework.security.authentication.event.LoggerListener internally in the constructor
and not via spring IoC ( as desired ) because spring.framework does a last-safeguard check on all beans
( including inner beans ) where IF bean is instanceof ApplicationListener AND is a singleton-scoped bean, then
add if on-the-fly to the listeners list ( which would wound up bringing us back to the issue above )
,
https://github.com/spring-projects/spring-framework/blob/v4.1.5.RELEASE/spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java#L349-L355
Constructor and Description |
---|
PentahoLoggerListener() |
PentahoLoggerListener(org.springframework.security.authentication.event.LoggerListener loggerListener) |
Modifier and Type | Method and Description |
---|---|
boolean |
isLogInteractiveAuthenticationSuccessEvents() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
setLogInteractiveAuthenticationSuccessEvents(boolean logInteractiveAuthenticationSuccessEvents) |
public PentahoLoggerListener()
public PentahoLoggerListener(org.springframework.security.authentication.event.LoggerListener loggerListener)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public boolean isLogInteractiveAuthenticationSuccessEvents()
public void setLogInteractiveAuthenticationSuccessEvents(boolean logInteractiveAuthenticationSuccessEvents)
Copyright © 2019 Hitachi Vantara. All rights reserved.