Package com.sun.sgs.app

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


        // 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

     * <p>
     * @param room the room this player should be in, or {@code null}
     */
    protected void setRoom(SwordWorldRoom room) {
        DataManager dataManager = AppContext.getDataManager();
        dataManager.markForUpdate(this);

        if (room == null) {
            currentRoomRef = null;
            return;
        }
View Full Code Here

        DataManager dm = AppContext.getDataManager();
        Map<String, ManagedReference<AvatarCellMO>> clientAvatars = avatars.get(clientID);
        if (clientAvatars==null) {
            clientAvatars = new HashMap();

            dm.markForUpdate(this);
            avatars.put(clientID, clientAvatars);
        }
        clientAvatars.put(avatarName, dm.createReference(avatar));
    }
   
View Full Code Here

     * @param session
     * @param protocol
     */
    void login(WonderlandClientID clientID) {
        DataManager dm = AppContext.getDataManager();
        dm.markForUpdate(this);

        if (activeClients==null) {
            activeClients = new HashSet<WonderlandClientID>();
        }
       
View Full Code Here

     * @param listener the listener to notify on log in or log out.  Listener
     * must implement ManagedObject.
     */
    public void addUserListener(UserListener listener) {
        DataManager dm = AppContext.getDataManager();
        dm.markForUpdate(this);
        userListeners.add(dm.createReference(listener));
    }

    /**
     * Remove a user listener from this user
View Full Code Here

     * Remove a user listener from this user
     * @param listener the listener to remove
     */
    public void removeUserListener(UserListener listener) {
        DataManager dm = AppContext.getDataManager();
        dm.markForUpdate(this);
        userListeners.remove(dm.createReference(listener));
    }

    /**
     * Get user listeners
View Full Code Here

     * Log the user in from the specificed session.
     * @param session
     */
    public void login(WonderlandClientID clientID) {
        DataManager dm = AppContext.getDataManager();
        dm.markForUpdate(this);

        // issue 963: session could be null if client is in the process of
        // logging out
        if (clientID.getSession() == null) {
            return;
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.