osgi - How do I fail in my declarative services activator? -
what's best way fail in activate() method of declarative service when know failure unrecoverable? specifically: service configurable via configadmin metatype properties. if configuration invalid (say malformed url example) what's best practice way fail? current practice throw illegalargumentexception. there better way? ds host pay attention exception type, or exceptions treated same?
the 4.2 spec says "if activate method throws exception, scr must log error message containing exception log service, if present, , component configuration not activated." suggests me can throw exception , doesn't matter one.
i've noticed ds retry activate method under circumstances, if 1 of other dependencies changes. there mechanism tell infrastructure don't bother unless configuration fixed? or should not worry , accept activator called few times?
any exception fine.
i think accept activator may tried again. when configuration fixed may happen @ time. disable component, how know when reenable it?
Comments
Post a Comment