Examples of ByteArrayKey


Examples of org.infinispan.util.ByteArrayKey

   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 {
         assert Arrays.equals(valueBytes, (byte[])cacheValue.data());
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

            case FLOAT_IDENTIFIER:
               return Float.parseFloat(value);
            case BOOLEAN_IDENTIFIER:
               return Boolean.parseBoolean(value);
            case BYTEARRAYKEY_IDENTIFIER:
               return new ByteArrayKey(Base64.decode(value));
            case NATIVE_BYTEARRAYKEY_IDENTIFIER:
               return Base64.decode(value);
            default:
               throw new IllegalArgumentException("Unsupported type code: " + type);
         }
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

            case FLOAT_IDENTIFIER:
               return Float.parseFloat(value);
            case BOOLEAN_IDENTIFIER:
               return Boolean.parseBoolean(value);
            case BYTEARRAYKEY_IDENTIFIER:
               return new ByteArrayKey(Base64.decode(value));
            default:
               throw new IllegalArgumentException("Unsupported type code: " + type);
         }
      } else {
         return key;
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

   private void assertCacheContainsKey(SocketAddress serverAddress, byte[] keyBytes) {
      CacheContainer cacheContainer = hrServ2CacheManager.get(serverAddress);
      Cache<Object, Object> cache = cacheContainer.getCache();
      DataContainer dataContainer = cache.getAdvancedCache().getDataContainer();
      assert dataContainer.keySet().contains(new ByteArrayKey(keyBytes));
   }
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

            case FLOAT_IDENTIFIER:
               return Float.parseFloat(value);
            case BOOLEAN_IDENTIFIER:
               return Boolean.parseBoolean(value);
            case BYTEARRAYKEY_IDENTIFIER:
               return new ByteArrayKey(Base64.decode(value));
            default:
               throw new IllegalArgumentException("Unsupported type code: " + type);
         }
      } else {
         return key;
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

         assert inf.toString().contains("in object java.lang.Object@");
      }
   }

   public void testByteArrayKey() throws Exception {
      ByteArrayKey o = new ByteArrayKey("123".getBytes());
      marshallAndAssertEquality(o);
   }
View Full Code Here

Examples of org.infinispan.util.ByteArrayKey

   }

   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");
View Full Code Here

Examples of org.jacorb.poa.util.ByteArrayKey

     * @exception ServantAlreadyActive if an error occurs
     */
    protected synchronized void add( byte[] oid, Servant servant )
        throws ObjectAlreadyActive, ServantAlreadyActive
    {
        ByteArrayKey oidbak = new ByteArrayKey (oid);

        /* an inCarnation and activation with the same oid has
           priority, a reactivation for the same oid blocks until
           etherealization is complete */

 
View Full Code Here

Examples of org.jacorb.poa.util.ByteArrayKey


    protected synchronized StringPair[] deliverContent()
    {
        StringPair[] result = new StringPair[objectMap.size()];
        ByteArrayKey oidbak;
        Enumeration en = objectMap.keys();

        for ( int i = 0; i < result.length; i++ )
        {
            oidbak = (ByteArrayKey) en.nextElement();
            result[i] = new StringPair
            (
                oidbak.toString(),
                objectMap.get(oidbak).getClass().getName()
            );
        }
        return result;
View Full Code Here

Examples of org.jacorb.poa.util.ByteArrayKey

        if (!unique)
        {
            throw new POAInternalError("error: not UNIQUE_ID policy (getObjectId)");
        }

        ByteArrayKey oidbak = (ByteArrayKey)servantMap.get(servant);

        if (oidbak != null)
        {
            return oidbak.getBytes();
        }

        return null;
    }
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.