[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2571) Event observers in overridden components are still being invoked
Sebastien Degardin (JIRA)
jira-events at lists.jboss.org
Sat Feb 9 21:22:03 EST 2008
[ http://jira.jboss.com/jira/browse/JBSEAM-2571?page=comments#action_12399015 ]
Sebastien Degardin commented on JBSEAM-2571:
--------------------------------------------
Another options, which could be more interesting would be to not process any overriden field or method.
In the method below, we could call a Reflection utility method like "isMethodOverridden(Method method, Class componentClass)"
So that we would know if we have to process such a method.
Here is an example of such solution in ( class org.jboss.seam.Component ) :
for (Class superClass = clazz ; superClass!=Object.class; superClass = superClass.getSuperclass() )
{
for ( Method method: superClass.getDeclaredMethods() )
{
if (! Reflections.isMethodOverriden(method, clazz))
{
scanMethod(applicationContext, selectionSetters, dataModelNames, method);
}
}
}
> Event observers in overridden components are still being invoked
> ----------------------------------------------------------------
>
> Key: JBSEAM-2571
> URL: http://jira.jboss.com/jira/browse/JBSEAM-2571
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.1.GA
> Reporter: Shane Bryzak
> Assigned To: Shane Bryzak
> Priority: Blocker
> Fix For: 2.0.2.GA
>
>
> When overriding a built in component and providing a new observer, the observer in the overridden component is still registered and both observers are invoked upon the event. Here is a test case provided by a user that reproduces this issue:
> @Name("org.jboss.seam.security.facesSecurityEvents")
> @Scope(ScopeType.APPLICATION)
> @Install(precedence = Install.APPLICATION, classDependencies = "javax.faces.context.FacesContext")
> @BypassInterceptors
> @Startup
> public class SecurityEventsHandler extends org.jboss.seam.security.FacesSecurityEvents {
> @Logger Log log;
>
> @Override @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
> public void addLoginSuccessfulMessage()
> {
> log.info("\n\n\n>>>>>>>>>>>>>>>>>>>>EVENT_LOGIN_SUCCESSFUL handled<<<<<<<<<<<<<<<<<<<<<<<<\n\n\n");
> }
>
>
> }
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list