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 java.util.UUID;

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

	public InvalidationSynchronization(NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor, Object[] keys) {
		this.nonTxPutFromLoadInterceptor = nonTxPutFromLoadInterceptor;
		this.keys = keys;
	}

	@Override
	public void beforeCompletion() {}

	@Override
	public void afterCompletion(int status) {
		nonTxPutFromLoadInterceptor.broadcastEndInvalidationCommand(keys, uuid);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy