@Override
    public void initialize()
    {
        log.debug( "Initializing" );

        initDelegate();
        try {
            if (MAX_ITEMS_FLUSH > 0) {
                flushTask = new TimerTask()
                {
                    @Override
                    public void run() { flushPendingChanges(false ); } // this member only
                };
                TaskEngine.getInstance().schedule(flushTask, Duration.ofMillis(Math.abs(prng.nextLong())%flushTimerDelay.toMillis()), flushTimerDelay);
            }

        } catch (Exception ex) {
            log.error("Failed to initialize pubsub maintenance tasks", ex);
        }
    }
Cache for recently accessed published items.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProvider.java