About Question enthuware.jwpv6.2.595 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Presi Priya

Re: About Question enthuware.jwpv6.2.595 :

Post by Presi Priya »

D. If the Runnable passed to asyncContext.start(runnable), calls asyncContext.dispatch().

But I read, asyncContext.complete() or asyncContext.dispatch() brings an end to async processing.!!

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by admin »

Presi Priya wrote:D. If the Runnable passed to asyncContext.start(runnable), calls asyncContext.dispatch().

But I read, asyncContext.complete() or asyncContext.dispatch() brings an end to async processing.!!
As per JavaDoc API documentation for dispatch: There can be at most one asynchronous dispatch operation per asynchronous cycle, which is started by a call to one of the ServletRequest#startAsync methods. Any attempt to perform an additional asynchronous dispatch operation within the same asynchronous cycle will result in an IllegalStateException.

HTH,
Paul.

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by gurpreet_asrgndu »

this is regarding the option 5 as said by presi priya

the asyncContext.dispatch() will dispatch the request , response to the target of the dispatch method. now when the target will complete execution say by completing its service method then the container automatically has to call AsyncContext.complete() method which will result in onComplete method of AsyncListener be called.

but still have a doubt what happens if the dispatched target again calls startAsync().

mtmmjava
Posts: 9
Joined: Mon Nov 04, 2013 7:49 am
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by mtmmjava »

In regards to the last alternative: as per my understanding of the specs, if the user sets AsyncContext#setTimeout to a negative value, no infinite loop will ever make it call onTimeout, don't you agree?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by admin »

mtmmjava wrote:In regards to the last alternative: as per my understanding of the specs, if the user sets AsyncContext#setTimeout to a negative value, no infinite loop will ever make it call onTimeout, don't you agree?
Yes, that is true but it is a special case. The problem statement has now been updated to make it clear.

thank you for your feedback!
Paul.

DesRenthuware
Posts: 32
Joined: Wed Aug 28, 2013 6:12 am
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by DesRenthuware »

Hi.

Small typo:

"In which of the following cases an AsyncListener's...".

Think the "may" that comes later in the line has probably been moved around a bit...

Thanks.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by admin »

DesRenthuware wrote:Hi.

Small typo:

"In which of the following cases an AsyncListener's...".

Think the "may" that comes later in the line has probably been moved around a bit...

Thanks.
It says, "In which of the following cases an AsyncListener's methods may be invoked by the container?"
Seems ok to me. What am I missing?
-Paul.

DesRenthuware
Posts: 32
Joined: Wed Aug 28, 2013 6:12 am
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by DesRenthuware »

Hi Paul.

Maybe just an American/UK/South African language structure variance. Over my side of the world I would have expected the sentence to be something like:

"In which of the following cases may an AsyncListener's methods be invoked by the container?"

I initially assumed that the sentence may have been rephrased at some point and the placement of "may" was moved (It looked odd to me). It's impossible to cater to the whole worlds language variances, so if you are happy, just ignore me. ;)

Thanks.

PS: don't get me started on, "...he did fantastic". :D

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.595 :

Post by admin »

I think you are right. Your version sounds better :) I have changed it.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests