-
1. Re: Cancelling an @Asynchronous method with Future.cancel
david_b Feb 14, 2011 6:33 PM (in response to david_b)I still haven't resolved this problem, but looking into it further the calling side is behaving correctly. Attempting to use the future after the calling cancel results in a CancellationException.
Edit: I tried testing for Thread.interrupted() in the asynchronous call but that doesn't work either.
Given that the container manages all threading, could it be that the container is preventing the interrupt from being delivered?
-
2. Re: Cancelling an @Asynchronous method with Future.cancel
nickarls Feb 15, 2011 1:42 AM (in response to david_b)Just guessing here but have you tried it with other beans that @Stateless? I'm not sure what's supposed to happen once the "true" call to he stateless bean is complete...
-
3. Re: Cancelling an @Asynchronous method with Future.cancel
wolfc Feb 15, 2011 6:01 AM (in response to nickarls)Cancallation of asynchronous requests is not available in AS 6.0.0.
-
4. Re: Cancelling an @Asynchronous method with Future.cancel
david_b Feb 15, 2011 5:00 PM (in response to wolfc)Thanks, that would be why it's not working
Is there a way to find out when this feature will be implemented?
-
5. Cancelling an @Asynchronous method with Future.cancel
david_b Feb 15, 2011 6:57 PM (in response to david_b)If anyone else encounters this problem, I've found a way around it using JMS.
My session bean creates a temporary queue, then sends an "acknowledge" type message to the caller via JMS with the replyTo address set to the temporary queue. The caller can send a "cancel" message to the temporary queue, which the bean checks periodically during processing.
It's much more complex but it works on AS 6.0.0. When cancelling an asynchronous call is supported I will switch to the simpler option.