Examples of NodeKey


Examples of com.android.manifmerger.XmlNode.NodeKey

     * an explicit declaration in the application targeted SDK.
     * @param xmlElement the implied element that was added to the resulting xml.
     * @param reason optional contextual information whey the implied element was added.
     */
    void recordImpliedNodeAction(XmlElement xmlElement, String reason) {
        NodeKey storageKey = xmlElement.getId();
        Actions.DecisionTreeRecord nodeDecisionTree = mRecords.get(storageKey);
        if (nodeDecisionTree == null) {
            nodeDecisionTree = new Actions.DecisionTreeRecord();
            mRecords.put(storageKey, nodeDecisionTree);
        }
View Full Code Here

Examples of com.android.manifmerger.XmlNode.NodeKey

     */
    synchronized void recordNodeAction(
            XmlElement mergedElement,
            Actions.NodeRecord nodeRecord) {

        NodeKey storageKey = mergedElement.getId();
        Actions.DecisionTreeRecord nodeDecisionTree = mRecords.get(storageKey);
        if (nodeDecisionTree == null) {
            nodeDecisionTree = new Actions.DecisionTreeRecord();
            mRecords.put(storageKey, nodeDecisionTree);
        }
View Full Code Here

Examples of com.android.manifmerger.XmlNode.NodeKey

        return null;
    }

    private List<Actions.AttributeRecord> getAttributeRecords(XmlAttribute attribute) {
        XmlElement originElement = attribute.getOwnerElement();
        NodeKey storageKey = originElement.getId();
        Actions.DecisionTreeRecord nodeDecisionTree = mRecords.get(storageKey);
        // by now the node should have been added for this element.
        assert (nodeDecisionTree != null);
        List<Actions.AttributeRecord> attributeRecords =
                nodeDecisionTree.mAttributeRecords.get(attribute.getName());
View Full Code Here

Examples of org.infinispan.tree.NodeKey

   public void testPersistence() throws CacheLoaderException {
      cache.put("/a/b/c", "key", "value");
      assert "value".equals(cache.get("/a/b/c", "key"));

      assert store.containsKey(new NodeKey(Fqn.fromString("/a/b/c"), DATA));
      assert "value".equals(nodeContentsInCacheStore(store, Fqn.fromString("/a/b/c")).get("key"));
      assert store.containsKey(new NodeKey(Fqn.fromString("/a/b/c"), STRUCTURE));

      restartCache();
      assert "value".equals(cache.get("/a/b/c", "key"));
      assert store.containsKey(new NodeKey(Fqn.fromString("/a/b/c"), DATA));
      assert "value".equals(nodeContentsInCacheStore(store, Fqn.fromString("/a/b/c")).get("key"));
      assert store.containsKey(new NodeKey(Fqn.fromString("/a/b/c"), STRUCTURE));
   }
View Full Code Here

Examples of org.infinispan.tree.NodeKey

   }

   public void testRootNodePersistence() throws CacheLoaderException {
      cache.put(ROOT, "key", "value");
      assert "value".equals(cache.get(ROOT, "key"));
      assert store.containsKey(new NodeKey(ROOT, DATA));
      assert "value".equals(nodeContentsInCacheStore(store, ROOT).get("key"));
      assert store.containsKey(new NodeKey(ROOT, STRUCTURE));

      restartCache();
      assert "value".equals(cache.get(ROOT, "key"));

      assert store.containsKey(new NodeKey(ROOT, DATA));
      assert "value".equals(nodeContentsInCacheStore(store, ROOT).get("key"));
      assert store.containsKey(new NodeKey(ROOT, STRUCTURE));
   }
View Full Code Here

Examples of org.infinispan.tree.NodeKey

      assert "v".equals(cache.get(Fqn.fromElements("a", "b"), "k"));
   }

   @SuppressWarnings("unchecked")
   private Map<String, String> nodeContentsInCacheStore(CacheStore cs, Fqn fqn) throws CacheLoaderException {
      return (Map<String, String>) cs.load(new NodeKey(fqn, DATA)).getValue();
   }
View Full Code Here

Examples of org.infinispan.tree.NodeKey

   }

   protected boolean isNodeLocked(Fqn fqn) {
      TransactionManager tm = cache.getAdvancedCache().getTransactionManager();
      TransactionTable tt = cache.getAdvancedCache().getComponentRegistry().getComponent(TransactionTable.class);
      CacheEntry structure = lookupEntryFromCurrentTransaction(tt, tm, new NodeKey(fqn, NodeKey.Type.STRUCTURE));
      CacheEntry data = lookupEntryFromCurrentTransaction(tt, tm, new NodeKey(fqn, NodeKey.Type.DATA));
      return structure != null && data != null && structure.isChanged() && data.isChanged();
   }
View Full Code Here

Examples of org.infinispan.tree.NodeKey

   private void doTest(List<Fqn> fqns) {
      LockContainer container = new ReentrantStripedLockContainer(512);
      Map<Lock, Integer> distribution = new HashMap<Lock, Integer>();
      for (Fqn f : fqns) {
         NodeKey dataKey = new NodeKey(f, NodeKey.Type.DATA);
         NodeKey structureKey = new NodeKey(f, NodeKey.Type.STRUCTURE);
         addToDistribution(container.getLock(dataKey), distribution);
         addToDistribution(container.getLock(structureKey), distribution);
      }

      System.out.println("Distribution: " + distribution);
View Full Code Here

Examples of org.infinispan.tree.NodeKey

      // loop thru the Fqn, starting at its root, and make sure all of its children exist in proper NodeKeys
      for (int i = 0; i < fqn.size(); i++) {
         Fqn parent = fqn.getSubFqn(0, i);
         Object childName = fqn.get(i);
         // make sure a data key exists in the cache
         assert c.containsKey(new NodeKey(parent, NodeKey.Type.DATA)) : "Node [" + parent + "] does not have a Data atomic map!";
         assert c.containsKey(new NodeKey(parent, NodeKey.Type.STRUCTURE)) : "Node [" + parent + "] does not have a Structure atomic map!";
         AtomicMap<Object, Fqn> am = AtomicMapLookup.getAtomicMap(c, new NodeKey(parent, NodeKey.Type.STRUCTURE));
         boolean hasChild = am.containsKey(childName);
         assert hasChild : "Node [" + parent + "] does not have a child [" + childName + "] in its Structure atomic map!";
      }
   }
View Full Code Here

Examples of org.infinispan.tree.NodeKey

public class NodeKeyExternalizer implements Externalizer {
   private static final byte DATA_BYTE = 1;
   private static final byte STRUCTURE_BYTE = 2;

   public void writeObject(ObjectOutput output, Object object) throws IOException {
      NodeKey key = (NodeKey) object;
      output.writeObject(key.getFqn());
      byte type = 0;
      switch (key.getContents()) {
         case DATA:
            type = DATA_BYTE;
            break;
         case STRUCTURE:
            type = STRUCTURE_BYTE;
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.