commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juozas Baliuka <bali...@mwm.lt>
Subject RE: [simplestore] what Exceptions do we need?
Date Fri, 25 Jan 2002 16:54:03 GMT
At 01:34 PM 1/25/2002 +0100, you wrote:
>Hi,
>
> >> >Hi,
> >> >1."ServiceNotAvailableException" is useful to handle fatal erros, "Log
> >> >message,send SNS for admin .... "
> >> >
> >> >2."NotFoundException" <==> "KeyNotFoundException" is useful to optimize
> >> >"get" without   "contais" and for null result, nul is also "good"
>value.
> >>
> >>
> >>A Exception seems to be cleaner in this case. What do you think.
> >>
> >> >3."KeyNotUniqueException" <==> "DublicateKeyException" is usefull
for
> >> >"put", because it returns "void" and  store can be used without
>"contais".
> >>
> >>Yep.
> >>
> >> >all of them not useful for memory stores, because they use Map for
>internal
> >> >optimizations and in case "ServiceNotAvailableException" it impossible
>to
> >> >handle, handling will fail :)
> >> >But for stores like "JDBCStore", "FileStore", "RemoteStore" exceptions
>are
> >> >very useful.
> >>
> >>;-) ok what's your statement. Yes or No for Exceptions?
> >
> >Yes, for for Exceptions !!!.
>
>Yes that I wanna hear ;).
>I vote for:
>KeyNotFoundException
>KeyNotUniqueException
>
>ServiceNotAvailableException
>I don't see yet. But if want it then I will book it in!
  Yes, some ServiceUnavailableException is usfull to hanle, like "Out of 
disk space, connection is lost, ...."
  but there are no good way handle it in store. We can define error handler 
interface and handlers can be can be registered by user :
  public interface ErrorHandler {

     void handle(Store store,ServiceUnavailableException sue);

}

store.registerErrorHandler(

              new ErrorHandler(){

                   void handle(Store store,ServiceUnavailableException sue){

                              MailUtils.sendMal("baliuka@mwm.lt","your 
store "+store.toString()+" is dead", sue.getMessage() ) );

                    }

   }

);


>   Gerhard
>
>
>--
>To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message