Package org.infinispan.server.core

Examples of org.infinispan.server.core.CacheValue.data()


   @Override
   public Object decodeValue(Object value) throws CodecException {
      if (value != null) {
         try {
            CacheValue cv = (CacheValue) value;
            return marshaller.objectFromByteBuffer(cv.data());
         } catch (Exception e) {
            throw log.valueDecodingFailed(e, this.getName());
         }
      } else {
         return null;
View Full Code Here


   private InternalCacheEntry getInternalCacheEntry(Cache<ByteArrayKey, CacheValue> cache, String key, String value) throws Exception {
      InternalCacheEntry entry = cache.getAdvancedCache().getDataContainer().get(toBinaryKey(key));
      if (value != null) {
         CacheValue v = (CacheValue) entry.getValue();
         AssertJUnit.assertEquals(toBinaryValue(value), v.data());
      }
      return entry;
   }

   private ByteArrayKey toBinaryKey(String key) throws Exception {
View Full Code Here

      ByteArrayKey cacheKey = new ByteArrayKey(keyBytes);
      CacheValue cacheValue = (CacheValue) cache.get(cacheKey);
      if (value == null) {
         assert cacheValue == null : "Expected null value but received: " + cacheValue;
      } else {
         assert Arrays.equals(valueBytes, (byte[])cacheValue.data());
      }
   }
}
View Full Code Here

   public void testEntryWrapping() throws Exception {
      remoteSourceCache.put("k1", "v1");
      remoteSourceCache.put("k2", "v2");
      ByteArrayKey key = new ByteArrayKey(marshaller.objectToByteBuffer("k1"));
      CacheValue cv1 = targetCache.get(key);
      assertEquals(marshaller.objectToByteBuffer("v1"), cv1.data());
      String v1 = remoteTargetCache.get("k1");
      assertEquals("v1", v1);
      String v2 = remoteTargetCache.get("k2");
      assertEquals("v2", v2);
   }
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.