Class ExecutorServiceSessionValidationScheduler
java.lang.Object
org.apache.shiro.session.mgt.ExecutorServiceSessionValidationScheduler
- All Implemented Interfaces:
Runnable,SessionValidationScheduler
public class ExecutorServiceSessionValidationScheduler
extends Object
implements SessionValidationScheduler, Runnable
SessionValidationScheduler implementation that uses a
ScheduledExecutorService to call ValidatingSessionManager.validateSessions() every
sessionValidationInterval milliseconds.- Since:
- 0.9
-
Constructor Summary
ConstructorsConstructorDescriptionExecutorServiceSessionValidationScheduler(ValidatingSessionManager sessionManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidDisables the session validation job.voidCreates a single threadScheduledExecutorServiceto validate sessions at fixed intervals and enables this scheduler.longbooleanReturnstrueif this Scheduler is enabled and ready to begin validation at the appropriate time,falseotherwise.voidrun()voidsetSessionManager(ValidatingSessionManager sessionManager) voidsetSessionValidationInterval(long sessionValidationInterval) voidsetThreadNamePrefix(String threadNamePrefix)
-
Constructor Details
-
ExecutorServiceSessionValidationScheduler
-
ExecutorServiceSessionValidationScheduler
-
-
Method Details
-
getSessionManager
-
setSessionManager
-
getSessionValidationInterval
-
setSessionValidationInterval
-
isEnabled
Description copied from interface:SessionValidationSchedulerReturnstrueif this Scheduler is enabled and ready to begin validation at the appropriate time,falseotherwise. It does not indicate if the validation is actually executing at that instant - only that it is prepared to do so at the appropriate time.- Specified by:
isEnabledin interfaceSessionValidationScheduler- Returns:
trueif this Scheduler is enabled and ready to begin validation at the appropriate time,falseotherwise.
-
setThreadNamePrefix
-
getThreadNamePrefix
-
enableSessionValidation
Creates a single threadScheduledExecutorServiceto validate sessions at fixed intervals and enables this scheduler. The executor is created as a daemon thread to allow JVM to shut down- Specified by:
enableSessionValidationin interfaceSessionValidationScheduler
-
run
-
disableSessionValidation
Description copied from interface:SessionValidationSchedulerDisables the session validation job.- Specified by:
disableSessionValidationin interfaceSessionValidationScheduler
-