Package org.cometd

Examples of org.cometd.Client


    {
        Log.info(this+": "+clientId+" is oort "+oortUrl);
        if (!_knownCommets.containsKey(oortUrl))
            observeComet(oortUrl);
       
        Client client = _bayeux.getClient(clientId);
       
        client.addExtension(new RemoteOortClientExtension());
    }
View Full Code Here


                    {
                        Session s =restoreSession(bin);
                        ((BayeuxSession)s).access(System.currentTimeMillis());
                        ((Request)_bayeux.getCurrentRequest()).setSession(s);
                        String cid=message.getClientId();
                        Client client = _bayeux.getClient(cid);
                        ((BayeuxSession)s).setClient(client);
                        addSession(s);
                        Log.info("Restored session "+s.getId()+" for bayeux client "+cid);
                    }
                    catch(Exception e)
View Full Code Here

        public Message sendMeta(Message message)
        {
            if (message.getChannel().equals(Bayeux.META_HANDSHAKE))
            {
                String cid=message.getClientId();
                Client client = _bayeux.getClient(cid);
                ((BayeuxSession)_bayeux.getCurrentRequest().getSession(true)).setClient(client);
            }
            return message;
        }
View Full Code Here

        Channel channel=_bayeux.getChannel(channelId,true);

        if (((ChannelImpl)channel).getChannelId().isWild())
        {
            final Method m=method;
            Client wild_client=_bayeux.newClient(_name + "-wild");
            wild_client.addListener(_listener instanceof MessageListener.Asynchronous?new AsyncWildListen(wild_client,m):new SyncWildListen(wild_client,m));
            channel.subscribe(wild_client);
        }
        else
        {
            _methods.put(channelId,method);
View Full Code Here

     * @see dojox.cometd.Client#remove(boolean)
     */
    public void remove(boolean timeout)
    {
        _isExpired=timeout;
        Client client=_bayeux.removeClient(_id);

        if (client != null && _bayeux.isLogInfo())
            _bayeux.logInfo("Remove client " + client + " timeout=" + timeout);

        final String browser_id;
View Full Code Here

        for (String peerName : peerNames)
        {
            String peerId = membersMap.get(peerName);
            if (peerId!=null)
            {
                Client peer = getBayeux().getClient(peerId);
                if (peer!=null)
                    peers.add(peer);
            }
        }
View Full Code Here

    {
        Log.info(this+": "+clientId+" is oort "+oortUrl);
        if (!_knownCommets.containsKey(oortUrl))
            observeComet(oortUrl);
       
        Client client = _bayeux.getClient(clientId);
       
        client.addExtension(new RemoteOortClientExtension());
    }
View Full Code Here

        for (String peerName : peerNames)
        {
            String peerId = membersMap.get(peerName);
            if (peerId!=null)
            {
                Client peer = getBayeux().getClient(peerId);
                if (peer!=null)
                    peers.add(peer);
            }
        }

        if (peers.size() > 0)
        {
            Map<String, Object> message = new HashMap<String, Object>();
            message.put("chat", data.get("chat"));
            message.put("user", data.get("user"));
            message.put("scope", "private");
            for (Client peer : peers)
                peer.deliver(client, roomName, message, null);
            client.deliver(getClient(), roomName, message, null);
        }
    }
View Full Code Here

    {
        synchronized(this)
        {
            if (client_id==null)
                return null;
            Client client = _clients.get(client_id);
            return client;
        }
    }
View Full Code Here

     */
    public void remove(boolean timeout)
    {
        synchronized(this)
        {
            Client client=_bayeux.removeClient(_id);  
            if (_bayeux.isLogInfo())
                _bayeux.logInfo("Remove client "+client+" timeout="+timeout);
            if (_browserId!=null)
                _bayeux.clientOffBrowser(getBrowserId(),_id);
            _browserId=null;
View Full Code Here

TOP

Related Classes of org.cometd.Client

Copyright © 2018 www.massapicom. 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.