Examples of objectToByteBuffer()


Examples of org.infinispan.marshall.jboss.GenericJBossMarshaller.objectToByteBuffer()

   public void testHotRodEncoding() throws Exception {
      Cache<ByteArrayKey, CacheValue> cache = cacheManager.getCache();
      RemoteCache<String, String> remoteCache = remoteCacheManager.getCache();
      remoteCache.put("k1", "v1");
      GenericJBossMarshaller marshaller = new GenericJBossMarshaller();
      ByteArrayKey k1 = new ByteArrayKey(marshaller.objectToByteBuffer("k1"));
      assertTrue(cache.containsKey(k1));

      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "encoding hotrod;");
      Map<String, String> response = interpreter.execute(sessionId, "get k1;");
View Full Code Here

Examples of org.infinispan.marshall.jboss.GenericJBossMarshaller.objectToByteBuffer()

      CacheLoaderManager loaderManager = cr.getComponent(CacheLoaderManager.class);
      List<RemoteCacheStore> stores = loaderManager.getCacheLoaders(RemoteCacheStore.class);
      Marshaller marshaller = new GenericJBossMarshaller();
      byte[] knownKeys;
      try {
         knownKeys = marshaller.objectToByteBuffer(MIGRATION_MANAGER_HOT_ROD_KNOWN_KEYS);
      } catch (Exception e) {
         throw new CacheException(e);
      }

      for (RemoteCacheStore store : stores) {
View Full Code Here

Examples of org.infinispan.marshall.jboss.JBossMarshaller.objectToByteBuffer()

      remoteCache.put(key, "v");
      assertOnlyServerHit(getAddress(hotRodServer2));
      TcpTransportFactory tcpTp = (TcpTransportFactory) TestingUtil.extractField(remoteCacheManager, "transportFactory");

      Marshaller sm = new JBossMarshaller();
      TcpTransport transport = (TcpTransport) tcpTp.getTransport(sm.objectToByteBuffer(key, 64));
      try {
      assertEquals(transport.getServerAddress(), new InetSocketAddress("localhost", hotRodServer2.getPort()));
      } finally {
         tcpTp.releaseTransport(transport);
      }
View Full Code Here

Examples of org.infinispan.marshall.jboss.JBossMarshaller.objectToByteBuffer()

      @Override
      public Object getKey() {
         String result = String.valueOf(r.nextLong());
         Marshaller sm = new JBossMarshaller();
         try {
            return sm.objectToByteBuffer(result, 64);
         } catch (IOException e) {
            throw new RuntimeException(e);
         } catch (InterruptedException e) {
            throw new RuntimeException(e);
         }
View Full Code Here

Examples of org.infinispan.marshall.jboss.JBossMarshaller.objectToByteBuffer()

      assert cache.isEmpty();
   }

   private void assertCacheContains(Cache cache, String key, String value) throws Exception {
      Marshaller marshaller = new JBossMarshaller();
      byte[] keyBytes = marshaller.objectToByteBuffer(key, 64);
      byte[] valueBytes = marshaller.objectToByteBuffer(value, 64);
      ByteArrayKey cacheKey = new ByteArrayKey(keyBytes);
      CacheValue cacheValue = (CacheValue) cache.get(cacheKey);
      if (value == null) {
         assert cacheValue == null : "Expected null value but received: " + cacheValue;
View Full Code Here

Examples of org.infinispan.marshall.jboss.JBossMarshaller.objectToByteBuffer()

   }

   private void assertCacheContains(Cache cache, String key, String value) throws Exception {
      Marshaller marshaller = new JBossMarshaller();
      byte[] keyBytes = marshaller.objectToByteBuffer(key, 64);
      byte[] valueBytes = marshaller.objectToByteBuffer(value, 64);
      ByteArrayKey cacheKey = new ByteArrayKey(keyBytes);
      CacheValue cacheValue = (CacheValue) cache.get(cacheKey);
      if (value == null) {
         assert cacheValue == null : "Expected null value but received: " + cacheValue;
      } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.