Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athiththan11/b1156885c454c5613fbb953c21fb7ca4 to your computer and use it in GitHub Desktop.
Save athiththan11/b1156885c454c5613fbb953c21fb7ca4 to your computer and use it in GitHub Desktop.
Service component registration for defective password validator
@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