cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: How to handle a configuration problem generally in CXF code
Date Wed, 08 Oct 2008 23:17:59 GMT
I would propose to add the following to UncheckedException and 
corresponding "super" calls to all exceptions.

    public UncheckedException(String code, ResourceBundle bundle, 
Object...params) {
        this(new Message(code, bundle, params));
    }
   
    public UncheckedException(String code, Throwable t, ResourceBundle 
bundle, Object...params) {
        this(new Message(code, bundle, params), t);
    }

To use these you could do the following at the start of the class:
    static final Logger LOG = LogUtils.getL7dLogger(JMSConfigFeature.class);
    static final ResourceBundle BUNDLE = LOG.getResourceBundle();

and then:
throw new ConfigurationException("JMSCONFIGFEATURE_ONLY_JMS", BUNDLE);

I have checked where the i18n Message is used and it seems only to be 
used for exceptions. So would it perhaps make sense to deprecate it and 
always create exceptions like above?
Was there a special reason for the introduction of i18n Message?
Any opinions?

Greetings

Christian


Benson Margulies schrieb:
> I'm +1 to the constructor. I find the new-ing of messages to be a pain.
>
> On Tue, Oct 7, 2008 at 5:27 PM, Christian Schneider <chris@die-schneider.net
>   
>> wrote:
>>     
>
>   


-- 

Christian Schneider
---
http://www.liquid-reality.de


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message