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

org.infinispan.interceptors.InvocationExceptionHandler Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.interceptors;

import org.infinispan.commands.VisitableCommand;
import org.infinispan.context.InvocationContext;
import org.infinispan.interceptors.impl.ReturnValueStage;

/**
 * Callback interface for {@link InvocationStage#exceptionally(InvocationExceptionHandler)}.
 *
 * @author Dan Berindei
 * @since 9.0
 */
@FunctionalInterface
public interface InvocationExceptionHandler extends InvocationComposeHandler {
   Object apply(InvocationContext rCtx, VisitableCommand rCommand, Throwable t) throws Throwable;

   @Override
   default BasicInvocationStage apply(BasicInvocationStage stage, InvocationContext rCtx, VisitableCommand rCommand, Object rv,
         Throwable t) throws Throwable {
      if (t == null) return stage;

      return new ReturnValueStage(rCtx, rCommand, apply(rCtx, rCommand, t));
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy