
org.wildfly.clustering.session.cache.CompositeImmutableSessionFactory Maven / Gradle / Ivy
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.session.cache;
import org.wildfly.clustering.session.ImmutableSession;
import org.wildfly.clustering.session.ImmutableSessionAttributes;
import org.wildfly.clustering.session.ImmutableSessionMetaData;
import org.wildfly.clustering.session.cache.attributes.ImmutableSessionAttributesFactory;
import org.wildfly.clustering.session.cache.metadata.ImmutableSessionMetaDataFactory;
/**
* Generic immutable session factory implementation - independent of cache mapping strategy.
* @author Paul Ferraro
* @param the session metadata type
* @param the session attributes type
*/
public class CompositeImmutableSessionFactory implements ImmutableSessionFactory {
private final ImmutableSessionMetaDataFactory metaDataFactory;
private final ImmutableSessionAttributesFactory attributesFactory;
public CompositeImmutableSessionFactory(ImmutableSessionMetaDataFactory metaDataFactory, ImmutableSessionAttributesFactory attributesFactory) {
this.metaDataFactory = metaDataFactory;
this.attributesFactory = attributesFactory;
}
@Override
public ImmutableSessionMetaDataFactory getMetaDataFactory() {
return this.metaDataFactory;
}
@Override
public ImmutableSessionAttributesFactory getAttributesFactory() {
return this.attributesFactory;
}
@Override
public ImmutableSession createImmutableSession(String id, ImmutableSessionMetaData metaData, ImmutableSessionAttributes attributes) {
return new CompositeImmutableSession(id, metaData, attributes);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy