Issue Details (XML | Word | Printable)

Key: BEEHIVE-1051
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Kenneth Tam
Reporter: Xibin Zeng
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Beehive

Control Interceptor SPI missing throwable for event dispatching

Created: 27/Jan/06 05:20 AM   Updated: 27/Jan/06 12:37 PM
Return to search
Component/s: Controls
Affects Version/s: 1.0.1
Fix Version/s: 1.0.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works ControlBean.vm.diff 2006-01-27 05:46 AM Kenneth Tam 5 kB
File Licensed for inclusion in ASF works Interceptor.java.diff 2006-01-27 05:46 AM Kenneth Tam 0.2 kB
Environment: ALL

Resolution Date: 27/Jan/06 12:37 PM


 Description  « Hide
There are 4 methods on the org.apache.beehive.controls.spi.svc.Interceptorinterface.

For a control operation, preInvoke/postInvoke are called before and after the operation, respectively. The postInvoke callback contains the exception that the operation threw. For preEvent/postEvent, which is called before and after control event dispatching, however, there is no exception information passed to the postEvent callback. This looks inconsistent to me.

Imagine that you need to enforce J2EE transaction behaviors using these interceptors (i.e. rollback a transaction in case of a system exception), you will need to know what exception has been generated as the result of invoking the operation or event callback. You could do this for your control operations, but not event callbacks, since the exception caught during event callback isn't passsed to the interceptor.

In my humble opinion, I think we should make preInvoke/postinvoke and preEvent/postEvent API's symmetric.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Xibin Zeng added a comment - 27/Jan/06 05:22 AM
Correction - the name of the interface is

org.apache.beehive.controls.spi.svc.Interceptor

Kenneth Tam added a comment - 27/Jan/06 05:46 AM
Good catch. Here's a proposed fix that makes postEvent symmetric with postInvoke (adding the return value and throwable to the postEvent signature). Does this solve your issue, Xibin?

Kenneth Tam added a comment - 27/Jan/06 12:37 PM
Fixed as of rev 372680