File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes handling timeouts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "handling timeouts" Watch "handling timeouts" New topic
Author

handling timeouts

Ansari Raffik
Greenhorn

Joined: Feb 05, 2007
Posts: 7
Can anyone suggest me how a java client invoking a https service handle time-outs?..
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
I suppose it depends on the Http client that you choose.

The Jakarta Commons HttpClient has a TimeoutController class that allows you to execute either a Runnable or Thread object with a specified timeout. It throws a TimeoutController.TimeoutException.

What you do to handle such an exception depends entirely on the application requirements. You could retry the task immediately, log the event and exit, rotate the task to the end of the queue, or any other scheme that you choose.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: handling timeouts