[jboss-dev-forums] [Design of JBoss Remoting, Unified Invokers] - Re: Interruption and the Remoting 3 API
trustin
do-not-reply at jboss.com
Mon Sep 17 22:31:05 EDT 2007
If the invocation is interrupted by Thread.interrupt(), throwing InterruptedException would be reasonable, but as you pointed out, it's painful to take care of another catch block.
We could provide both interruptable and uninterruptable invocation methods; invoke and invokeUninterruptably (or invoke and invokeInterruptably) Then user could choose what they want.
What confuses me though is if we are talking about the InterruptedException raised by Thread.interrupt() or any other interruption caused by means such as cancellation request for the invocation. Or are they treated as the same thing? Do we need to discriminate these two cases?
I'd prefer to have a subclass of RemotingException (e.g. CancelledInvocationException) if we need discrimination. Users can deal with the interruption when they really want to do. This will also help users to find out if its interrupted by Thread.interrupt(), any system signal or request for cancellation from the type of the raised exception.
Users will not consider the possibility of the interrupted invocation at all at the first time, but they will start to consider once they see the exception log, so I think it's not a big deal.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085300#4085300
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085300
More information about the jboss-dev-forums
mailing list