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

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

There is a newer version: 4.0.0.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.Session;

/**
 * A session facade whose lifecycle is managed by a {@link org.wildfly.clustering.server.cache.Cache}.
 * @param  the session context type
 * @author Paul Ferraro
 */
public class CachedSession extends DecoratedSession implements CacheableSession {

	private final Runnable closeTask;

	public CachedSession(Session session, Runnable closeTask) {
		super(session);
		this.closeTask = closeTask;
	}

	@Override
	public void close() {
		this.closeTask.run();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy