dev@javaserverfaces.java.net

Re: [REVIEW] Issue #66 - Possible optimization regarding execution of PhaseListeners

From: Jacob Hookom <jacob_at_hookom.net>
Date: Thu, 11 Nov 2004 22:08:21 -0600

Ed,

"If there are three phaseListeners installed, A, B, C. If B throws an
exception on beforePhase, only A must be called on afterPhase."

I think there is a problem with the testAfterListenerException() where B
throws an exception on afterPhase, and that A should then only be called
once in the beforePhase. This goes against section 11.3 of the spec where:

"The JSF implementation must guarantee that, if beforePhase() has been
called on a particular instance, then afterPhase() will also be called."

Therefore, A should also be called in the afterPhase even if B or C
throws an exception. Let me know what you think and I will submit
another changebundle.

-Jacob


Ed Burns wrote:

>Thanks for doing this. I like the performance enhancement, but you need
>to change one thing to conform to the new spec, which has been vetted by
>EG discussion so I don't want to change it.
>
>
>
>>>>>>On Mon, 08 Nov 2004 20:48:04 -0600, Jacob Hookom <jacob_at_hookom.net> said:
>>>>>>
>>>>>>
>
>JH> *Note* New implementation does scope exception catching on a
>JH> per-PhaseListener where the previous implementation was scoped on
>JH> before/after phase. I would like to propose not catching at all since
>JH> the API does not specify any exceptions to be thrown on beforePhase or
>JH> afterPhase. Also, all the tests ran successfully with the one change to
>JH> TestLifeCycleImpl in leu of changes to exception scoping.
>
>JH> Issue #66
>
>JH> Performance Enhancements to LifeCycleImpl
>
>JH> SECTION: Changes
>
>JH> M src/com/sun/faces/lifecycle/LifecycleImpl.java
>JH> - Used ArrayList cloning to prevent lengthy synchronization blocks.
>JH> - Exceptions from PhaseListeners will not prevent other pertinent
>JH> listeners from being fired.
>
>JH> M test/com/sun/faces/lifecycle/TestLifecycleImpl.java
>JH> - In leu of the changes to exception handling, all registered listeners
>JH> will be called, even if 'b' throws an exception.
>
>This test must remain unchanged since it accurately tests that the
>implementation conforms to the spec. For example.
>
>If there are three phaseListeners installed, A, B, C. If B throws an
>exception on beforePhase, only A must be called on afterPhase.
>
>Can you produce a version of your change that has the good performance
>properties, but continues to allow TestLifeCycleImpl to execute
>unchanged?
>
>Thanks,
>
>Ed
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net