Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 6.1.6
-
Fix Version/s: None
-
Component/s: J2EE/Extra
-
Labels:None
-
Environment:n/a
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
When I use HttpClient and HttpExchange.ContentExchange you start the client, send the contentExchange and wait for a the data to arrive. If the connection failed, you wait forever (all Exceptions are caught, but not visible)
httpClient.send(contentExchange );
contentExchange.waitForStatus(HttpExchange.STATUS_COMPLETED); //now wait forever if it failed
which is now changed to:
httpClient.send(contentExchange );
contentExchange.waitForStatusOrFailure(HttpExchange.STATUS_COMPLETED);
if (contentExchange.getHasFailed())
When a connection fails a boolean is set in the exchange and if it is applicable it is notified.
Hi David,
I think this subclassing of the ContentExchange can be very useful for those cases where the caller wants to be synchronous. However, there are many cases where the caller is async. as well, so won't be waiting, so I don't think we'd incorporate this feature into the base ContentExchange class.
However, I think it probably would be a good idea to document this on the jetty wiki so others can benefit - you should have permission to add a page to the jetty wiki at: http://docs.codehaus.org/display/JETTY/Jetty+Documentation
Let me know when you've done it and I'll link it into the right place, or if you have trouble doing it and I'll see if I can help out.
cheers
Jan