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

org.hibernate.cache.infinispan.access.InvalidationSynchronization Maven / Gradle / Ivy

There is a newer version: 5.6.15.Final
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.cache.infinispan.access;

import javax.transaction.Status;

/**
 * Synchronization that should release the locks after invalidation is complete.
 *
 * @author Radim Vansa <[email protected]>
 */
public class InvalidationSynchronization implements javax.transaction.Synchronization {
	public final Object lockOwner;
	private final NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor;
	private final Object key;

	public InvalidationSynchronization(NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor, Object key, Object lockOwner) {
		this.nonTxPutFromLoadInterceptor = nonTxPutFromLoadInterceptor;
		this.key = key;
		this.lockOwner = lockOwner;
	}

	@Override
	public void beforeCompletion() {}

	@Override
	public void afterCompletion(int status) {
		nonTxPutFromLoadInterceptor.endInvalidating(key, lockOwner, status == Status.STATUS_COMMITTED || status == Status.STATUS_COMMITTING);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy