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

org.infinispan.factories.InboundInvocationHandlerFactory Maven / Gradle / Ivy

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

import org.infinispan.factories.annotations.DefaultFactoryFor;
import org.infinispan.remoting.inboundhandler.NonTotalOrderPerCacheInboundInvocationHandler;
import org.infinispan.remoting.inboundhandler.NonTotalOrderTxPerCacheInboundInvocationHandler;
import org.infinispan.remoting.inboundhandler.PerCacheInboundInvocationHandler;
import org.infinispan.remoting.inboundhandler.TotalOrderTxPerCacheInboundInvocationHandler;

/**
 * Factory class that creates instances of {@link org.infinispan.remoting.inboundhandler.PerCacheInboundInvocationHandler}.
 *
 * @author Pedro Ruivo
 * @since 7.1
 */
@DefaultFactoryFor(classes = PerCacheInboundInvocationHandler.class)
public class InboundInvocationHandlerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {

   @Override
   public  T construct(Class componentType) {
      if (!configuration.clustering().cacheMode().isClustered()) {
         return null;
      } else if (configuration.transaction().transactionMode().isTransactional()) {
         //noinspection unchecked
         return configuration.transaction().transactionProtocol().isTotalOrder() ?
               (T) new TotalOrderTxPerCacheInboundInvocationHandler() :
               (T) new NonTotalOrderTxPerCacheInboundInvocationHandler();
      } else {
         //noinspection unchecked
         return (T) new NonTotalOrderPerCacheInboundInvocationHandler();
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy