Package com.sun.sgs.app

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


  }

  /** Removes some entries, returning true if there is more to do. */
  private boolean doWork() {
      DataManager dataManager = AppContext.getDataManager();
      dataManager.markForUpdate(this);
            ScalableHashMap<K, V> node = currentNodeRef.get();
      /* Find the leaf node */
      if (!node.isLeafNode()) {
    while (true) {
        currentNodeRef =
View Full Code Here


    }
    valueRef = dm.createReference(newValue);
      } else if (isKeyValuePair()) {
                ManagedSerializable<KeyValuePair<K, V>> msPair =
        uncheckedCast(keyOrPairRef.get());
                dm.markForUpdate(msPair);
    msPair.get().setValue(newValue);
      } else if (isKeyWrapped()) {
    /* Switch from wrapping key to wrapping key/value pair */
    ManagedSerializable<K> msKey =
        uncheckedCast(keyOrPairRef.get());
View Full Code Here

    /* Switch from wrapping key to wrapping key/value pair */
    ManagedSerializable<K> msKey =
        uncheckedCast(keyOrPairRef.get());
                ManagedSerializable<KeyValuePair<K, V>> msPair =
        uncheckedCast(keyOrPairRef.get());
                dm.markForUpdate(msPair);
                msPair.set(new KeyValuePair<K, V>(msKey.get(), newValue));
    if (isValueWrapped()) {
        dm.removeObject(valueRef.get());
    }
    setKeyValuePair();
View Full Code Here

        // NOTE: we can't directly save the item in the list, or
        // we'll end up with a local copy of the item. Instead, we
        // must save a ManagedReference to the item.

        DataManager dataManager = AppContext.getDataManager();
        dataManager.markForUpdate(this);

        return items.add(dataManager.createReference(item));
    }

    /**
 
View Full Code Here

    public boolean addPlayer(SwordWorldPlayer player) {
        logger.log(Level.INFO, "{0} enters {1}",
            new Object[] { player, this });

        DataManager dataManager = AppContext.getDataManager();
        dataManager.markForUpdate(this);

        return players.add(dataManager.createReference(player));
    }

    /**
 
View Full Code Here

    public boolean removePlayer(SwordWorldPlayer player) {
        logger.log(Level.INFO, "{0} leaves {1}",
            new Object[] { player, this });

        DataManager dataManager = AppContext.getDataManager();
        dataManager.markForUpdate(this);

        return players.remove(dataManager.createReference(player));
    }

    /**
 
View Full Code Here

     *
     * @param session the session this player is logged in on
     */
    protected void setSession(ClientSession session) {
        DataManager dataMgr = AppContext.getDataManager();
        dataMgr.markForUpdate(this);

        currentSessionRef = dataMgr.createReference(session);

        logger.log(Level.INFO,
            "Set session for {0} to {1}",
View Full Code Here

     * Sets the referenced DummyManagedObject, calling markForUpdate to note
     * the modification.
     */
    public void setNext(DummyManagedObject next) {
  DataManager dataManager = AppContext.getDataManager();
  dataManager.markForUpdate(this);
  this.next = dataManager.createReference(next);
    }

    public boolean equals(Object object) {
  return object instanceof DummyManagedObject &&
View Full Code Here

        public void run() throws Exception {
            TestMultiNodeTaskServiceImpl.lastNodeUsed.
                set(AppContext.getManager(NodeIdManager.class).getNodeId());
            DataManager dataManager = AppContext.getDataManager();
            Counter counter = (Counter) dataManager.getBinding("counter");
            dataManager.markForUpdate(counter);
            counter.decrement();
        }
    }

    public interface NodeIdManager {
View Full Code Here

  if (o == null) {
      throw new NullPointerException("null element");
  }
  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;
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.