This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: handling timeouts