1

Topic: Canceling of previous requests AJAX (JBoss, Spring MVC)

On a client part the user selects a temporal range for display of objects to a card. Accordingly at range change on the server the request for re-creation of layers is sent, this re-creation can occupy the considerable time. Therefore in the beginning of handling of request I want to beat all executable previous requests, and then immediately to recreate layers. Whether there is an easy method to make it? While as a variant bluntly flag which is installed in currentThread () by the next request and which further in the course of request handling periodically .

2

Re: Canceling of previous requests AJAX (JBoss, Spring MVC)

P> Therefore in the beginning of handling of request I want to beat all executable previous requests, and then immediately to recreate layers. Whether P> there is an easy method to make it? P> while as a variant bluntly flag which is installed in currentThread () by the next request P> and which further in the course of request handling periodically . The lung is not present, but there are standard. Operation you turn in FutureTask and you give to thread pool. At FutureTask is cancel (). If the task is not fulfilled yet, it simply remove from queue. If it is fulfilled, to a flow make interrupt () - and here the code because anything standard here is not present already begins and cannot be." Periodically  "it is replaced on if (Thread.interrupted ()) {stop_processing} Pluses of this approach on comparing with an own flag - interrupt () also pulls out the task from waiting IO of operation, from wait () etc. But here, of course, it is necessary to walk on the code and at last to remove all catch (InterruptedException ex) {/* that for , is done nothing */} and to make normal handling

3

Re: Canceling of previous requests AJAX (JBoss, Spring MVC)

Hello, bzig, you wrote: B>... interrupt () also pulls out the task from waiting IO of operation... Unless pulls out?

4

Re: Canceling of previous requests AJAX (JBoss, Spring MVC)

Hello, PZI, you wrote: PZI> Hello, bzig, you wrote: B>>... interrupt () also pulls out the task from waiting IO of operation... PZI> Unless pulls out? Re-read docks - really, only from NIO operations pulls out, that from old to quit IO is only a time-out to put and again to check Thread.isInterrupted ()