public static ImageCaptchaService captchaService() {
try {
if (_captchaService == null) {
String captchaEngineClass = ERXProperties.stringForKeyWithDefault("er.captcha.captchaEngineClass", ERCaptchaEngine.class.getName());
CaptchaEngine captchaEngine = (CaptchaEngine) Class.forName(captchaEngineClass).newInstance();
_captchaService = new DefaultManageableImageCaptchaService(new FastHashMapCaptchaStore(), captchaEngine, 180, 100000, 75000);
}
return _captchaService;
}
catch (Throwable t) {
throw new RuntimeException("Failed to initialize captcha engine.", t);