Package org.infinispan.client.hotrod

Examples of org.infinispan.client.hotrod.RemoteCacheManager


      hotRodServer = TestHelper.startHotRodServer(cacheManager);

      ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
      clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort());
      clientBuilder.marshaller(new ProtoStreamMarshaller());
      remoteCacheManager = new RemoteCacheManager(clientBuilder.build());

      remoteCache = remoteCacheManager.getCache();

      //initialize client-side serialization context
      MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager));
View Full Code Here


   public void start() throws CacheLoaderException {
      super.start();
      StreamingMarshaller marshaller = getMarshaller();

      if (marshaller == null) {throw new IllegalStateException("Null marshaller not allowed!");}
      remoteCacheManager = new RemoteCacheManager(marshaller, config.getHotRodClientProperties());
      if (config.getRemoteCacheName().equals(CacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(config.getRemoteCacheName());
   }
View Full Code Here

         marshaller = new GenericJBossMarshaller();
      } else {
         marshaller = ctx.getMarshaller();
      }
      ConfigurationBuilder builder = buildRemoteConfiguration(configuration, marshaller);
      remoteCacheManager = new RemoteCacheManager(builder.build());

      if (configuration.remoteCacheName().equals(BasicCacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(configuration.remoteCacheName());
View Full Code Here

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

      sourceRemoteCacheManager = new RemoteCacheManager("localhost", sourceServer.getPort());
      sourceRemoteCacheManager.start();
      sourceRemoteCache = sourceRemoteCacheManager.getCache();

      targetRemoteCacheManager = new RemoteCacheManager("localhost", targetServer.getPort());
      targetRemoteCacheManager.start();
      targetRemoteCache = targetRemoteCacheManager.getCache();
   }
View Full Code Here

         marshaller = new GenericJBossMarshaller();
      } else {
         marshaller = ctx.getMarshaller();
      }
      ConfigurationBuilder builder = buildRemoteConfiguration(configuration, marshaller);
      remoteCacheManager = new RemoteCacheManager(builder.build());

      if (configuration.remoteCacheName().equals(BasicCacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(configuration.remoteCacheName());
View Full Code Here

   public void start() throws CacheLoaderException {
      super.start();
      StreamingMarshaller marshaller = getMarshaller();

      if (marshaller == null) {throw new IllegalStateException("Null marshaller not allowed!");}
      remoteCacheManager = new RemoteCacheManager(marshaller, config.getHotRodClientProperties());
      if (config.getRemoteCacheName().equals(CacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(config.getRemoteCacheName());
   }
View Full Code Here

         marshaller = new GenericJBossMarshaller();
      } else {
         marshaller = ctx.getMarshaller();
      }
      ConfigurationBuilder builder = buildRemoteConfiguration(configuration, marshaller);
      remoteCacheManager = new RemoteCacheManager(builder.build());

      if (configuration.remoteCacheName().equals(BasicCacheContainer.DEFAULT_CACHE_NAME))
         remoteCache = remoteCacheManager.getCache();
      else
         remoteCache = remoteCacheManager.getCache(configuration.remoteCacheName());
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        cacheContainer = configuration.getCacheContainer();
        if (cacheContainer == null) {
            Configuration config = new ConfigurationBuilder().classLoader(Thread.currentThread().getContextClassLoader()).addServers(configuration.getHost()).build();
            cacheContainer = new RemoteCacheManager(config, true);
            isManagedCacheContainer = true;
        }
        super.doStart();
    }
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        cacheContainer = configuration.getCacheContainer();
        if (cacheContainer == null) {
            Configuration config = new ConfigurationBuilder().classLoader(Thread.currentThread().getContextClassLoader()).addServers(configuration.getHost()).build();
            cacheContainer = new RemoteCacheManager(config, true);
            isManagedCacheContainer = true;
        }
        super.doStart();
    }
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

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.