public void enableSessionValidation() {

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Scheduling session validation job using Quartz with "
                    + "session validation interval of [" + sessionValidationInterval + "]ms...");
        }

        try {
            TriggerBuilder<SimpleTrigger> triggerBuilder =
                    TriggerBuilder.newTrigger()
                            .withIdentity(getClass().getName(), Scheduler.DEFAULT_GROUP)
                            .withSchedule(simpleSchedule()
                                    .withIntervalInMilliseconds(sessionValidationInterval)
                                    .withRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY));
            SimpleTrigger trigger = triggerBuilder.build();

            JobDetail detail = JobBuilder.newJob(QuartzSessionValidationJob.class)
                    .withIdentity(JOB_NAME, Scheduler.DEFAULT_GROUP).build();
            detail.getJobDataMap().put(QuartzSessionValidationJob.SESSION_MANAGER_KEY, sessionManager);

            Scheduler scheduler = getScheduler();

            scheduler.scheduleJob(detail, trigger);
            if (schedulerImplicitlyCreated) {
                scheduler.start();
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Successfully started implicitly created Quartz Scheduler instance.");
                }
            }
            this.enabled = true;

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Session validation job successfully scheduled with Quartz.");
            }

        } catch (SchedulerException e) {
            if (LOGGER.isErrorEnabled()) {
                LOGGER.error("Error starting the Quartz session validation job.  Session validation may not occur.", e);
            }
        }
    }
Starts session validation by creating a Quartz simple trigger, linking it to
the {@link QuartzSessionValidationJob}, and scheduling it with the Quartz scheduler.
support/quartz/src/main/java/org/apache/shiro/session/mgt/quartz/QuartzSessionValidationScheduler.java