Search in sources :

Example 1 with ConcurrentSessionManager

use of org.wildfly.clustering.web.cache.session.ConcurrentSessionManager in project wildfly by wildfly.

the class HotRodSessionManagerFactory method createSessionManager.

@Override
public SessionManager<LC, TransactionBatch> createSessionManager(SessionManagerConfiguration<SC> configuration) {
    Registrar<SessionExpirationListener> expirationRegistrar = this.expirationRegistrar;
    Batcher<TransactionBatch> batcher = this.batcher;
    Duration transactionTimeout = this.transactionTimeout;
    HotRodSessionManagerConfiguration<SC> config = new HotRodSessionManagerConfiguration<SC>() {

        @Override
        public SessionExpirationListener getExpirationListener() {
            return configuration.getExpirationListener();
        }

        @Override
        public Registrar<SessionExpirationListener> getExpirationRegistrar() {
            return expirationRegistrar;
        }

        @Override
        public Supplier<String> getIdentifierFactory() {
            return configuration.getIdentifierFactory();
        }

        @Override
        public SC getServletContext() {
            return configuration.getServletContext();
        }

        @Override
        public Batcher<TransactionBatch> getBatcher() {
            return batcher;
        }

        @Override
        public Duration getStopTimeout() {
            return transactionTimeout;
        }
    };
    return new ConcurrentSessionManager<>(new HotRodSessionManager<>(this.factory, config), ConcurrentManager::new);
}
Also used : SessionExpirationListener(org.wildfly.clustering.web.session.SessionExpirationListener) TransactionBatch(org.wildfly.clustering.ee.cache.tx.TransactionBatch) ConcurrentManager(org.wildfly.clustering.ee.cache.ConcurrentManager) Duration(java.time.Duration) ConcurrentSessionManager(org.wildfly.clustering.web.cache.session.ConcurrentSessionManager)

Aggregations

Duration (java.time.Duration)1 ConcurrentManager (org.wildfly.clustering.ee.cache.ConcurrentManager)1 TransactionBatch (org.wildfly.clustering.ee.cache.tx.TransactionBatch)1 ConcurrentSessionManager (org.wildfly.clustering.web.cache.session.ConcurrentSessionManager)1 SessionExpirationListener (org.wildfly.clustering.web.session.SessionExpirationListener)1