It's not a secret anymore!
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "UnavailableException" Watch "UnavailableException" New topic


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{
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?
William Brogden
Author and all-around good cowpoke

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

author of:
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Bill.
I agree. Here's the link:
subject: UnavailableException
It's not a secret anymore!