Package com.sun.sgs.app

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


         * @return the protocol in use by that session, or null if the
         * sessionId does not exist
         */
        public CommunicationsProtocol get(ClientSession session) {
            DataManager dm = AppContext.getDataManager();
            ManagedReference sessionRef = dm.createReference(session);
           
            return protocolMap.get(sessionRef);
        }
    }
   
View Full Code Here


  }
  Entry<E> entry = new Entry<E>(o);
  DataManager dataManager = AppContext.getDataManager();
  dataManager.markForUpdate(this);
  ManagedReference<Entry<E>> entryRef =
      dataManager.createReference(entry);
  if (tailRef == null) {
      headRef = entryRef;
            tailRef = entryRef;
  } else {
      Entry<E> tail = tailRef.getForUpdate();
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public int hashCode() {
  DataManager dataManager = AppContext.getDataManager();
  return dataManager.createReference(this).getId().hashCode();
    }
   
    /** {@inheritDoc} */
    @Override
    public boolean equals(Object o) {
View Full Code Here

        if (o == null || !(o instanceof ManagedQueue)) {
            return false;
        }
        ManagedQueue<E> d = Objects.uncheckedCast(o);
        DataManager dm = AppContext.getDataManager();
        return dm.createReference(this).getId().equals(
                dm.createReference(d).getId());
    }

    /** {@inheritDoc} */
    @Override
View Full Code Here

            return false;
        }
        ManagedQueue<E> d = Objects.uncheckedCast(o);
        DataManager dm = AppContext.getDataManager();
        return dm.createReference(this).getId().equals(
                dm.createReference(d).getId());
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
View Full Code Here

     */
    public ScalableDeque() {
        backingMap = new ScalableHashMap<Element<E>, Long>();

        DataManager dm = AppContext.getDataManager();
        backingMapRef = dm.createReference(backingMap);

        // initialize the pointers to the front and end of the deque
        // to null.  However, the reference to these pointers will
        // always be non-null
        ManagedSerializable<ManagedReference<Element<E>>> head =
View Full Code Here

        ManagedSerializable<ManagedReference<Element<E>>> tail =
                new ManagedSerializable<ManagedReference<Element<E>>>(null);
        ManagedSerializable<Long> tailCount =
                new ManagedSerializable<Long>(0L);

        headElement = dm.createReference(head);
        headCounter = dm.createReference(headCount);
        tailElement = dm.createReference(tail);
        tailCounter = dm.createReference(tailCount);
    }
View Full Code Here

                new ManagedSerializable<ManagedReference<Element<E>>>(null);
        ManagedSerializable<Long> tailCount =
                new ManagedSerializable<Long>(0L);

        headElement = dm.createReference(head);
        headCounter = dm.createReference(headCount);
        tailElement = dm.createReference(tail);
        tailCounter = dm.createReference(tailCount);
    }

    /**
 
View Full Code Here

        ManagedSerializable<Long> tailCount =
                new ManagedSerializable<Long>(0L);

        headElement = dm.createReference(head);
        headCounter = dm.createReference(headCount);
        tailElement = dm.createReference(tail);
        tailCounter = dm.createReference(tailCount);
    }

    /**
     * Creates a {@code ScalableDeque} and adds all the elements in the
View Full Code Here

                new ManagedSerializable<Long>(0L);

        headElement = dm.createReference(head);
        headCounter = dm.createReference(headCount);
        tailElement = dm.createReference(tail);
        tailCounter = dm.createReference(tailCount);
    }

    /**
     * Creates a {@code ScalableDeque} and adds all the elements in the
     * provided collection according to their traversal ordering.
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.