I am using Maven-SCR. By using the @Component
and @Service
tags, I can have my class instance register the interfaces it provides automatically.
On occasion, however, the activate method (marked as @Activate
) or even the constructor, might throw an exception and fail in a way I can't handle.
The issue is: I want to catch that exception so I can properly log it, but at the same time, I want to prevent that the class publishes its services if it failed to activate or initialize.
How do you guys do this?
Thanks!