Last active
July 6, 2019 05:22
-
-
Save athiththan11/b1156885c454c5613fbb953c21fb7ca4 to your computer and use it in GitHub Desktop.
Service component registration for defective password validator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Activate | |
protected void activate(ComponentContext context) { | |
try { | |
context.getBundleContext().registerService(AbstractEventHandler.class.getName(), | |
new DefectivePasswordValidatorEventHandler(), null); | |
// initialize all defective passwords from the text file | |
DefaultDefectivePasswordValidator.getInstance().initValues(); | |
// initialize watchservice on /defective directory | |
initializeWatchService(); | |
} catch (Throwable e) { | |
log.error("Error occured while initializing service component", e); | |
} | |
} | |
@Deactivate | |
protected void deactivate(ComponentContext context) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment