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

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

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

import org.infinispan.commons.CacheConfigurationException;
import org.infinispan.factories.annotations.DefaultFactoryFor;
import org.infinispan.remoting.rpc.RpcManager;
import org.infinispan.remoting.rpc.RpcManagerImpl;

/**
 * A factory for the RpcManager
 *
 * @author Manik Surtani ([email protected])
 * @since 4.0
 */
@DefaultFactoryFor(classes = RpcManager.class)
public class RpcManagerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {

   @Override
   public  T construct(Class componentType) {
      if (!configuration.clustering().cacheMode().isClustered())
         return null;

      // only do this if we have a transport configured!
      if (!globalConfiguration.isClustered())
         throw new CacheConfigurationException("Transport should be configured in order to use clustered caches");

      return componentType.cast(new RpcManagerImpl());
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy