org.infinispan.hibernate.cache.v53.impl.InvalidationInvocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-hibernate-cache-v53 Show documentation
Show all versions of infinispan-hibernate-cache-v53 Show documentation
Infinispan Hibernate 5.3 Cache module
/*
* 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.infinispan.hibernate.cache.v53.impl;
import java.util.concurrent.CompletableFuture;
import org.infinispan.hibernate.cache.commons.access.NonTxPutFromLoadInterceptor;
import org.infinispan.hibernate.cache.commons.util.InfinispanMessageLogger;
/**
* Synchronization that should release the locks after invalidation is complete.
*
* @author Radim Vansa <[email protected]>
*/
public class InvalidationInvocation implements Invocation {
private final static InfinispanMessageLogger log = InfinispanMessageLogger.Provider.getLog(InvalidationInvocation.class);
private final Object lockOwner;
private final NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor;
private final Object key;
public InvalidationInvocation(NonTxPutFromLoadInterceptor nonTxPutFromLoadInterceptor, Object key, Object lockOwner) {
assert lockOwner != null;
this.nonTxPutFromLoadInterceptor = nonTxPutFromLoadInterceptor;
this.key = key;
this.lockOwner = lockOwner;
}
@Override
public CompletableFuture invoke(boolean success) {
if (log.isTraceEnabled()) {
log.tracef("After completion callback, success=%b", success);
}
nonTxPutFromLoadInterceptor.endInvalidating(key, lockOwner, success);
return null;
}
}