Package com.sun.sgs.app

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


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

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


            clientAvatars = new HashMap();

            dm.markForUpdate(this);
            avatars.put(clientID, clientAvatars);
        }
        clientAvatars.put(avatarName, dm.createReference(avatar));
    }
   
    /**
     * User has logged in from specified session with specificed protocol listener
     * @param session
View Full Code Here

     * 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
     * @param listener the listener to remove
View Full Code Here

     * @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
     * @return the user listeners
View Full Code Here

        // notify listeners for just this user
        for (ManagedReference<UserListener> listenerRef : user.getUserListeners()) {
            AppContext.getTaskManager().scheduleTask(
                    new UserListenerNotifier(listenerRef,
                                             dm.createReference(user),
                                             null,
                                             clientID,
                                             NotificationType.LOGIN));
        }
View Full Code Here

        // notify listeners for all users
        for (ManagedReference<UserListener> listenerRef : userListeners) {
            AppContext.getTaskManager().scheduleTask(
                    new UserListenerNotifier(listenerRef,
                                             dm.createReference(user),
                                             null,
                                             clientID,
                                             NotificationType.LOGIN));
        }
    }
View Full Code Here

       
        // add listener notification tasks to the queue, starting with
        // per-user listeners
        for (ManagedReference<UserListener> listener : user.getUserListeners()) {
            tasks.add(new UserListenerNotifier(listener,
                                               dm.createReference(user),
                                               dm.createReference(tasks),
                                               clientID,
                                               NotificationType.LOGOUT));
        }
       
View Full Code Here

        // add listener notification tasks to the queue, starting with
        // per-user listeners
        for (ManagedReference<UserListener> listener : user.getUserListeners()) {
            tasks.add(new UserListenerNotifier(listener,
                                               dm.createReference(user),
                                               dm.createReference(tasks),
                                               clientID,
                                               NotificationType.LOGOUT));
        }
       
        // next add global listeners
View Full Code Here

        }
       
        // next add global listeners
        for (ManagedReference<UserListener> listener : userListeners) {
            tasks.add(new UserListenerNotifier(listener,
                                               dm.createReference(user),
                                               dm.createReference(tasks),
                                               clientID,
                                               NotificationType.LOGOUT));
        }
View Full Code Here

       
        // next add global listeners
        for (ManagedReference<UserListener> listener : userListeners) {
            tasks.add(new UserListenerNotifier(listener,
                                               dm.createReference(user),
                                               dm.createReference(tasks),
                                               clientID,
                                               NotificationType.LOGOUT));
        }

        // now that we have collected all logout tasks, start running them
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.