All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.clustering.session.cache.CompositeImmutableSessionFactory Maven / Gradle / Ivy

There is a newer version: 5.0.7.Final
Show newest version
/*
 * 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