Package com.sun.sgs.app

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


           just keep a reference...otherwise, we make it part of our
           state, which has the effect of persisting the task. In either
           case we set one of the two fields to null to disambiguate
           what the situation is. */
        if (t instanceof ManagedObject) {
            taskRef = dm.createReference(t);
            task = null;
        } else {
            task = t;
            taskRef = null;
        }
View Full Code Here


            this.type     = type;
            this.clientID = clientID;
       
            // create references
            DataManager dm = AppContext.getDataManager();
            channelRef     = dm.createReference(channel);
        }
       
        public ConnectionType getClientType() {
            return type;
        }
View Full Code Here

            Set<WonderlandClientID> out = new LinkedHashSet<WonderlandClientID>();

            for (Iterator<ClientSession> i = channelRef.get().getSessions();
                 i.hasNext();)
            {
                ManagedReference<ClientSession> ref = dm.createReference(i.next());
                out.add(new WonderlandClientID(ref));
            }
           
            return out;
        }
View Full Code Here

            dm.markForUpdate(this);

            // add to the map
            HandlerRecord record = new HandlerRecord();
            record.ref = ref;
            record.channel  = dm.createReference(channel);
            record.sessions = dm.createReference(sessions);
            record.clientID = assignID;
            handlers.put(handler.getConnectionType(), record);
           
            return record.clientID;
View Full Code Here

            // add to the map
            HandlerRecord record = new HandlerRecord();
            record.ref = ref;
            record.channel  = dm.createReference(channel);
            record.sessions = dm.createReference(sessions);
            record.clientID = assignID;
            handlers.put(handler.getConnectionType(), record);
           
            return record.clientID;
        }
View Full Code Here

       
        public ManagedClientHandlerRef(ClientConnectionHandler handler) {
            super (null);
           
            DataManager dm = AppContext.getDataManager();
            ref = dm.createReference(handler);
        }
       
        @Override
        public ClientConnectionHandler get() {
            return ref.get();
View Full Code Here

     * session
     * @param session the session connected to this listener
     */
    public WonderlandSessionListener(ClientSession session) {
        DataManager dm = AppContext.getDataManager();
        sessionRef = dm.createReference(session);
       
        if (logger.isLoggable(Level.FINE)) {
            logger.finest("New session listener for " + session.getName());
        }
       
View Full Code Here

     * session
     * @param session the session connected to this listener
     */
    public ProtocolSessionListener(ClientSession session) {
        DataManager dm = AppContext.getDataManager();
        sessionRef = dm.createReference(session);
    }
   
    /**
     * Initialize the session listener
     */
 
View Full Code Here

            // the given protocol.  If the set does not exist, then
            // create it.
            ManagedReference<ProtocolClientSet> ref = clientMap.get(protocol);
            if (ref == null) {
                ProtocolClientSet sessions = new ProtocolClientSet();
                ref = dm.createReference(sessions);
                clientMap.put(protocol, ref);
            }
           
            ManagedReference<ClientSession> sessionRef = dm.createReference(session);
           
View Full Code Here

                ProtocolClientSet sessions = new ProtocolClientSet();
                ref = dm.createReference(sessions);
                clientMap.put(protocol, ref);
            }
           
            ManagedReference<ClientSession> sessionRef = dm.createReference(session);
           
            ProtocolClientSet sessions = ref.getForUpdate();
            sessions.add(sessionRef);
       
            // add a reference to the protocol from this client's session
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.