felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam lee <skyn...@gmail.com>
Subject how can I handle error condition during activate()?
Date Mon, 16 May 2011 19:47:30 GMT
Hey,

I have:

    @Activate
    private void activate(Map<String, ?> config) {
        cdnHost = OsgiUtil.toString(config.get(PROP_CDN_HOST), null);


        if (cdnHost == null) {
            // Do I throw an Exception here?
            // I don't want this component to be Activated if cdnHost isn't
set.
        }

    }


Is exception a proper way?
Or, is there a Service that I can @Reference, that has error flagging
methods?

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