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

UnavailableException

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I have a question about the UnavailableException(String msg, int seconds)
Say, we have
protected void doGet(HttpServletResponse res, HttpServletREquest req)throws IOException, ServletException{
if(someBoolean){
throw new UnavailableExeption("Unavailable from doGet", 10);
}
// some presentation here;
}
The first time we get a someBoolean==true, and the UnavailableExcption was thrown for 10 seconds. Then within 3 seconds, a second request comes in while someBoolean is still ==true; this time, will the UnavailableException be overridden to another 10 seconds?
Moreover, if, within 3 seconds, another request comes with someBoolean==false, will the presentation be shown, or it will be referred to the designated error page?
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12778
    
    5
By my reading of the API, subsequent requests will get a SERVICE_UNAVAILABLE (503) message until the time is up.
Bill

------------------
author of:
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Bill.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnavailableException