Package org.infinispan.client.hotrod

Examples of org.infinispan.client.hotrod.RemoteCacheManager


   @Override
   public void start() throws CacheLoaderException {
      super.start();
      if (config.getHotRodClientProperties().containsKey(ConfigurationProperties.MARSHALLER)) {
         remoteCacheManager = new RemoteCacheManager(config.getHotRodClientProperties(), true, config.getClassLoader(), config.getAsyncExecutorFactory());
      } else {
         Marshaller marshaller = config.isRawValues() ? new GenericJBossMarshaller() : getMarshaller();
         if (marshaller == null) {throw new IllegalStateException("Null marshaller not allowed!");}
         remoteCacheManager = new RemoteCacheManager(marshaller, config.getHotRodClientProperties(), true, config.getClassLoader(), config.getAsyncExecutorFactory());
      }
      if (config.getRemoteCacheName().equals(BasicCacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(config.getRemoteCacheName());
View Full Code Here


   @Override
   protected void setup() throws Exception {
      super.setup();
      hotrodServer = TestHelper.startHotRodServer(cacheManager);
      port = hotrodServer.getPort();
      remoteCacheManager = new RemoteCacheManager(
            new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
                  .addServers("localhost:" + hotrodServer.getPort()).build());
      remoteCacheManager.start();
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cacheManager);
      interpreter = gcr.getComponent(Interpreter.class);
View Full Code Here

      targetContainer = TestCacheManagerFactory.createCacheManager(targetConfigurationBuilder);
      targetServerCache = targetContainer.getCache();
      targetServer = TestHelper.startHotRodServer(targetContainer);

      sourceRemoteCacheManager = new RemoteCacheManager(
            new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
                  .addServers("localhost:" + sourceServer.getPort()).build());
      sourceRemoteCacheManager.start();
      sourceRemoteCache = sourceRemoteCacheManager.getCache();

      targetRemoteCacheManager = new RemoteCacheManager(
            new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
                  .addServers("localhost:" + sourceServer.getPort()).build());
      targetRemoteCacheManager.start();
      targetRemoteCache = targetRemoteCacheManager.getCache();
   }
View Full Code Here

            .startHotRodServer(cacheManager, port));
   }

   private void createHotRodCache(HotRodServer server) {
      hotrod = server;
      hotrodClient = new RemoteCacheManager(new ConfigurationBuilder()
            .addServers("localhost:" + hotrod.getPort())
            .marshaller(marshaller)
            .build());
      hotrodCache = cacheName.isEmpty()
            ? hotrodClient.<K, V>getCache()
View Full Code Here

      ConfigurationBuilder config = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false);
      createHotRodServers(NUM_SERVERS, config);
   }

   public void testConsistentHashPerf() throws Exception {
      RemoteCacheManager rcm = client(0);
      RemoteCache<Object, Object> cache = rcm.getCache();
      // This will initialize the consistent hash
      cache.put("k", "v");

      TcpTransportFactory transportFactory = (TcpTransportFactory) TestingUtil.extractField(rcm, "transportFactory");
      ConsistentHash ch = transportFactory.getConsistentHash();
View Full Code Here

      for (int i = 0; i < num; i++) {
         Properties props = new Properties();
         props.put(SERVER_LIST, String.format("localhost:%d", server(i).getPort()));
         props.put(PING_ON_STARTUP, "false");
         clients.add(new RemoteCacheManager(props));
      }
   }
View Full Code Here

      hotRodServer = TestHelper.startHotRodServer(cacheManager);

      Properties hotrodClientConf = new Properties();
      hotrodClientConf.put("infinispan.client.hotrod.server_list", "localhost:" + hotRodServer.getPort());
      hotrodClientConf.put("infinispan.client.hotrod.marshaller", ProtostreamMarshaller.class.getName());
      remoteCacheManager = new RemoteCacheManager(hotrodClientConf);
      remoteCache = remoteCacheManager.getCache();
      return cacheManager;
   }
View Full Code Here

      return this;
   }

   @Override
   public void start() {
      managerNoReturn = new RemoteCacheManager(servers, true);
      managerForceReturn = new RemoteCacheManager(servers, true);
   }
View Full Code Here

      return queryable;
   }

   @Override
   public void start() {
      managerNoReturn = new RemoteCacheManager(configuration, true);
      managerForceReturn = new RemoteCacheManager(configuration, true);
      if (queryable != null) {
         queryable.registerProtofilesRemote();
      }
   }
View Full Code Here

   public InfinispanClientListeners(Infinispan70HotrodService service) {
      this.service = service;
   }

   protected GenericClientListener getOrCreateListener(String cacheName) {
      final RemoteCacheManager remoteManager = service.getRemoteManager(false);
      if (cacheName == null)
         cacheName = remoteManager.getCache().getName();

      GenericClientListener listenerContainer = listeners.putIfAbsent(cacheName, new GenericClientListener());
      if (listenerContainer == null) {
         listenerContainer = listeners.get(cacheName);
         remoteManager.getCache().addClientListener(listenerContainer);
      }
      return listenerContainer;
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.RemoteCacheManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.