private void initDelegate()
    {
        // Check if we need to reset the provider class
        final Class clazz = DELEGATE.getValue();
        if (delegate == null || !clazz.equals(delegate.getClass())) {
            if ( delegate != null ) {
                delegate.shutdown();
                delegate = null;
            }
            try {
                log.info("Loading PubSub persistence provider to delegate to: {}.", clazz);
                delegate = (PubSubPersistenceProvider) clazz.newInstance();
                delegate.initialize();
            }
            catch (Exception e) {
                log.error("Error loading PubSub persistence provider to delegate to: {}. Using default provider instead.", clazz, e);
                delegate = new DefaultPubSubPersistenceProvider();
                delegate.initialize();
            }
        }
    }
Cache for recently accessed published items.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProvider.java