thrownewIllegalArgumentException("the max store size can\'t be less than garbage collection size. if you want to disable garbage collection (this is not recommended) you may set them equals (max=garbage)");
thrownewIllegalArgumentException("the max store size can\'t be less than garbage collection size. if you want to disable garbage collection (this is not recommended) you may set them equals (max=garbage)");
thrownewIllegalArgumentException("the max store size can\'t be less than garbage collection size. if you want to disable garbage collection (this is not recommended) you may set them equals (max=garbage)");
}else{
this.captchaStoreMaxSize=size;
}
}
publicintgetCaptchaStoreMaxSize(){
returnthis.captchaStoreMaxSize;
}
publicvoidgarbageCollectCaptchaStore(){
longnow=System.currentTimeMillis();
// id 垃圾回收
...
...
@@ -152,15 +160,15 @@ public abstract class AbstractManageableCaptchaService extends AbstractCaptchaSe
@@ -204,7 +212,7 @@ public abstract class AbstractManageableCaptchaService extends AbstractCaptchaSe
thrownewCaptchaServiceException("Store is full, try to increase CaptchaStore Size orto decrease time out, or to decrease CaptchaStoreSizeBeforeGrbageCollection");
}
}else{
if(this.isCaptchaStoreQuotaReached()){
if(this.isCaptchaStoreQuotaReached()){
logger.info("生成图形验证码时检测到, 容量已达配额, 执行垃圾回收");
this.garbageCollectCaptchaStore();
}
...
...
@@ -231,7 +239,7 @@ public abstract class AbstractManageableCaptchaService extends AbstractCaptchaSe