Hello,
What would be the best way to shutdown Karaf as soon as possible from a
Declarative Component that needs to run at startup.
This component will check some authorization API and decide if the user is
authorized to run the app. So, I thought to have a component with
@Component(immediate = true) and:
@Reference
private SystemService systemService;
@Activate
void init() {
if (!authorized()) {
systemService.halt();
}
}
Is this a good approach?
Should I add the bundle containing this component as a boot feature?
Any other advise?
Best regards,
Alex soto