Examples of DataManager


Examples of com.sun.sgs.app.DataManager

     * Sets the SwordWorld's One True Room to the given room.
     * <p>
     * @param room the room to set
     */
    public void setRoom(SwordWorldRoom room) {
        DataManager dataManager = AppContext.getDataManager();

        if (room == null) {
            roomRef = null;
            return;
        }

        roomRef = dataManager.createReference(room);
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

     * Creates a new instance of ViewCellCacheMO associated with the given
     * view.
     * @param view the view associated with this cache
     */
    public ViewCellCacheMO(ViewCellMO view) {
        DataManager dm = AppContext.getDataManager();
        viewRef = dm.createReference(view);
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

    {
        if (session == null) {
            throw new NullPointerException("null session");
        }

        DataManager dataMgr = AppContext.getDataManager();
        sessionRef = dataMgr.createReference(session);
        sessionName = session.getName();
       
        // Join the session to all channels.  We obtain the channel
        // in two different ways, by reference and by name.
        ChannelManager channelMgr = AppContext.getChannelManager();
View Full Code Here

Examples of com.sun.sgs.app.DataManager

    public void setSubTask(TrivialTimedTask subTask) {
        if (subTask == null) {
            subTaskRef = null;
            return;
        }
        DataManager dataManager = AppContext.getDataManager();
        subTaskRef = dataManager.createReference(subTask);
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

     * @param identity
     */
    UserMO(WonderlandIdentity identity) {
        this.identity = identity;

        DataManager dm = AppContext.getDataManager();
        logoutTasksRef = dm.createReference((Map<WonderlandClientID, Queue<Task>>)
                new ScalableHashMap<WonderlandClientID, Queue<Task>>());
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

     *
     * @param avatarName
     * @param avatar
     */
    public void putAvatar(WonderlandClientID clientID, String avatarName, AvatarCellMO avatar) {
        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

Examples of com.sun.sgs.app.DataManager

     * User has logged in from specified session with specificed protocol listener
     * @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

Examples of com.sun.sgs.app.DataManager

     * Add a listener to be notified when clients of this user log in or out.
     * @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));
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

    /**
     * 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));
    }
View Full Code Here

Examples of com.sun.sgs.app.DataManager

     */
    public static UserMO getUserMO(String username) {
        String userObjName = "user_"+username;
        UserMO user=null;
       
        DataManager dataMgr = AppContext.getDataManager();
        try {
            user = (UserMO) dataMgr.getBinding(userObjName);
        } catch(NameNotBoundException ex) {
            user = null;
        }
       
        return user;
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.