Package com.sun.sgs.app

Examples of com.sun.sgs.app.DataManager.createReference()


   * @param root the root node of the entire tree structure
   */
  AsynchronousClearTask(ScalableList<E> list) {
      assert (list != null);
      DataManager dm = AppContext.getDataManager();
      current = dm.createReference(list.getHead());
  }

  /**
   * The entry point of the task to perform the clear.
   */
 
View Full Code Here


        private TestProtocolSessionListener(ClientSession session) {
            logger.info("New session for " + session.getName());
           
            DataManager dm = AppContext.getDataManager();
            sessionRef = dm.createReference(session);
        }
           
        public void receivedMessage(ByteBuffer data) {
            logger.info("Received " + data.remaining() + " bytes from " +
                        getSession().getName() + ".");
View Full Code Here

                            ClientSession session)
            {
                this.sender = sender;
               
                DataManager dm = AppContext.getDataManager();
                sessionRef = dm.createReference(session);
            }

            public void run() throws Exception {
                sender.send(new TestMessageOne("Task: TestOne"));
                sender.send(sessionRef.get(), new TestMessageThree("Task: TestThree (private)", 42));
View Full Code Here

  int numLeaves = 1 << leafBits;

  DataManager dm = AppContext.getDataManager();
  dm.markForUpdate(this);
        ManagedReference<ScalableHashMap<K, V>> thisRef =
      dm.createReference(this);

  ScalableHashMap[] leaves = new ScalableHashMap[numLeaves];
  for (int i = 0; i < numLeaves; ++i) {
            ScalableHashMap<K, V> leaf = new ScalableHashMap<K, V>(
    depth + leafBits, minDepth, splitThreshold, 1 << maxDirBits);
View Full Code Here

  // for the linked list for the leaves
        for (int i = 1; i < numLeaves - 1; ++i) {
            ScalableHashMap<K, V> leaf = uncheckedCast(leaves[i]);
            leaf.leftLeafRef = uncheckedCast(
                    dm.createReference(leaves[i - 1]));
            leaf.rightLeafRef = uncheckedCast(
                    dm.createReference(leaves[i + 1]));
  }

  // edge updating - Note that since there are guaranteed to be at least
View Full Code Here

        for (int i = 1; i < numLeaves - 1; ++i) {
            ScalableHashMap<K, V> leaf = uncheckedCast(leaves[i]);
            leaf.leftLeafRef = uncheckedCast(
                    dm.createReference(leaves[i - 1]));
            leaf.rightLeafRef = uncheckedCast(
                    dm.createReference(leaves[i + 1]));
  }

  // edge updating - Note that since there are guaranteed to be at least
  // two leaves, these absolute offset calls are safe
        ScalableHashMap<K, V> firstLeaf = uncheckedCast(leaves[0]);
View Full Code Here

  // two leaves, these absolute offset calls are safe
        ScalableHashMap<K, V> firstLeaf = uncheckedCast(leaves[0]);
  firstLeaf.leftLeafRef = leftLeafRef;
  if (leftLeafRef != null) {
      ScalableHashMap<K, V> leftLeaf = leftLeafRef.get();
      leftLeaf.rightLeafRef = dm.createReference(firstLeaf);
  }
  firstLeaf.rightLeafRef = uncheckedCast(dm.createReference(leaves[1]));
        ScalableHashMap<K, V> lastLeaf = uncheckedCast(leaves[numLeaves - 1]);
  lastLeaf.leftLeafRef =
                uncheckedCast(dm.createReference(leaves[numLeaves - 2]));
View Full Code Here

  firstLeaf.leftLeafRef = leftLeafRef;
  if (leftLeafRef != null) {
      ScalableHashMap<K, V> leftLeaf = leftLeafRef.get();
      leftLeaf.rightLeafRef = dm.createReference(firstLeaf);
  }
  firstLeaf.rightLeafRef = uncheckedCast(dm.createReference(leaves[1]));
        ScalableHashMap<K, V> lastLeaf = uncheckedCast(leaves[numLeaves - 1]);
  lastLeaf.leftLeafRef =
                uncheckedCast(dm.createReference(leaves[numLeaves - 2]));
  lastLeaf.rightLeafRef = rightLeafRef;
  if (rightLeafRef != null) {
View Full Code Here

      leftLeaf.rightLeafRef = dm.createReference(firstLeaf);
  }
  firstLeaf.rightLeafRef = uncheckedCast(dm.createReference(leaves[1]));
        ScalableHashMap<K, V> lastLeaf = uncheckedCast(leaves[numLeaves - 1]);
  lastLeaf.leftLeafRef =
                uncheckedCast(dm.createReference(leaves[numLeaves - 2]));
  lastLeaf.rightLeafRef = rightLeafRef;
  if (rightLeafRef != null) {
      ScalableHashMap<K, V> rightLeaf = rightLeafRef.get();
      rightLeaf.leftLeafRef = dm.createReference(lastLeaf);
  }
View Full Code Here

  lastLeaf.leftLeafRef =
                uncheckedCast(dm.createReference(leaves[numLeaves - 2]));
  lastLeaf.rightLeafRef = rightLeafRef;
  if (rightLeafRef != null) {
      ScalableHashMap<K, V> rightLeaf = rightLeafRef.get();
      rightLeaf.leftLeafRef = dm.createReference(lastLeaf);
  }

  // since this node is now a directory, invalidate its leaf-list
  // references
  leftLeafRef = 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.