Package org.cometd.bayeux.server

Examples of org.cometd.bayeux.server.ServerChannel


    // This does nothing, remove it. XXX
  }

  public void serverPut(OutputLine line) {
    this.log.add(line);
    ServerChannel channel = this.bayeux.getChannel("/outputlog");
    if (channel != null) {
      channel.publish(this.localSession, line, null);
    }
  }
View Full Code Here


  public NamespaceBinding get(String session, String name)
    throws RuntimeException, InterruptedException
  {
    Map<String, Object> data = new HashMap<String, Object>(1);
    data.put("name", name);
    ServerChannel channel = getChannel(session);
    if (null == channel) {
      System.err.println("channel not found for session " + session);
      return null;
    }
    channel.publish(this.localSession, data, null);
    NamespaceBinding binding = getHandoff(session).take(); // blocks
    if (!binding.getName().equals(name)) {
      throw new RuntimeException("Namespace get, name mismatch.  Received " +
                                 binding.getName() + ", expected " + name);
    }
View Full Code Here

    data.put("name", name);
    if (!unset) {
      data.put("value", value);
    }
    data.put("sync", sync);
    ServerChannel channel = getChannel(session);
    if (null == channel) {
      System.err.println("channel not found for session " + session);
      return;
    }
    channel.publish(this.localSession, data, null);
    if (sync) {
      NamespaceBinding binding = getHandoff(session).take(); // blocks
      if (!binding.getName().equals(name)) {
        throw new RuntimeException("Namespace set, name mismatch.  Received " +
                                   binding.getName() + ", expected " + name);
View Full Code Here

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            if (channel != null) {
                logDelivery(exchange, channel);
                channel.publish(serverSession, exchange.getIn().getBody(), null);
            }
        }
View Full Code Here

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            try {
                if (channel != null) {
                    logDelivery(exchange, channel);
                    ServerMessage.Mutable mutable = binding.createCometdMessage(channel, serverSession,
                                                                                exchange.getIn());
                    channel.publish(serverSession, mutable);
                }
            } finally {
                if (disconnectLocalSession && serverSession.isLocalSession()) {
                    LOG.trace("Disconnection local session {}", serverSession);
                    serverSession.disconnect();
View Full Code Here

            exchange.setIn(message);

            consumer.getProcessor().process(exchange);

            if (ExchangeHelper.isOutCapable(exchange)) {
                ServerChannel channel = getBayeux().getChannel(channelName);
                ServerSession serverSession = getServerSession();

                ServerMessage.Mutable outMessage = binding.createCometdMessage(channel, serverSession, exchange.getOut());
                remote.deliver(serverSession, outMessage);
            }
View Full Code Here

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            if (channel != null) {
                logDelivery(exchange, channel);
                ServerMessage.Mutable mutable = binding.createCometdMessage(channel, serverSession, exchange.getIn());
                channel.publish(serverSession, mutable);
            }
        }
View Full Code Here

            exchange.setIn(message);

            consumer.getProcessor().process(exchange);

            if (ExchangeHelper.isOutCapable(exchange)) {
                ServerChannel channel = getBayeux().getChannel(channelName);
                ServerSession serverSession = getServerSession();

                ServerMessage.Mutable outMessage = binding.createCometdMessage(channel, serverSession, exchange.getOut());
                remote.deliver(serverSession, outMessage);
            }
View Full Code Here

        }
    }

    public ChatListener(BayeuxServer bayeuxServer, String name) {
        super(bayeuxServer, name);
        ServerChannel sc = bayeuxServer.getChannel("/" + name);
        if (sc != null) {
            sc.remove();
        }
        addService("/" + name, "processCometMessage");
        this.chatRoom = name;

    }
View Full Code Here

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            if (channel != null) {
                logDelivery(exchange, channel);
                ServerMessage.Mutable mutable = binding.createCometdMessage(channel, serverSession,
                                                                            exchange.getIn());
                channel.publish(serverSession, mutable);
            }
        }
View Full Code Here

TOP

Related Classes of org.cometd.bayeux.server.ServerChannel

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.