Package org.cometd.server

Examples of org.cometd.server.BayeuxServerImpl


  }

  @Singleton
  @Provides
  public final BayeuxServerImpl getBayeuxServer(final ObjectMapper om) {
    BayeuxServerImpl server = new BayeuxServerImpl();
    server.setOption(BayeuxServerImpl.JSON_CONTEXT, new JacksonJSONContextServer() {
      @Override
      public ObjectMapper getObjectMapper() {
        return om;
      }
    });
    configure(server);
    try {
      server.start();
    } catch (Exception e) {
      throw new RuntimeException(e.getMessage(), e);
    }
    return server;
  }
View Full Code Here


public class BayeauxPostProcessor implements BeanPostProcessor {

  @Override
  public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof BayeuxServerImpl) {
      BayeuxServerImpl bayeux = (BayeuxServerImpl) bean;

      // add the web socket transport
      bayeux.addTransport(new WebSocketTransport(bayeux));
    }

    return bean;
  }
View Full Code Here

                connectors.put(connectorKey, connectorRef);
            } else {
                connectorRef.increment();
            }

            BayeuxServerImpl bayeux = connectorRef.servlet.getBayeux();

            if (securityPolicy != null) {
                bayeux.setSecurityPolicy(securityPolicy);
            }
            if (extensions != null) {
                for (BayeuxServer.Extension extension : extensions) {
                    bayeux.addExtension(extension);
                }
            }
            prodcon.setBayeux(bayeux);
        }
    }
View Full Code Here

            this.producer = producer;
        }

        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

                connectors.put(connectorKey, connectorRef);
            } else {
                connectorRef.increment();
            }

            BayeuxServerImpl bayeux = connectorRef.servlet.getBayeux();

            if (securityPolicy != null) {
                bayeux.setSecurityPolicy(securityPolicy);
            }
            if (extensions != null) {
                for (BayeuxServer.Extension extension : extensions) {
                    bayeux.addExtension(extension);
                }
            }
            prodcon.setBayeux(bayeux);
        }
    }
View Full Code Here

            this.disconnectLocalSession = disconnectLocalSession;
        }

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

                connectors.put(connectorKey, connectorRef);
            } else {
                connectorRef.increment();
            }

            BayeuxServerImpl bayeux = connectorRef.servlet.getBayeux();

            if (securityPolicy != null) {
                bayeux.setSecurityPolicy(securityPolicy);
            }
            if (extensions != null) {
                for (BayeuxServer.Extension extension : extensions) {
                    bayeux.addExtension(extension);
                }
            }
            prodcon.setBayeux(bayeux);
        }
    }
View Full Code Here

            this.binding = cometdBinding;
        }

        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());
View Full Code Here

                connectors.put(connectorKey, connectorRef);
            } else {
                connectorRef.increment();
            }

            BayeuxServerImpl bayeux = connectorRef.servlet.getBayeux();

            if (securityPolicy != null) {
                bayeux.setSecurityPolicy(securityPolicy);
            }
            if (extensions != null) {
                for (BayeuxServer.Extension extension : extensions) {
                    bayeux.addExtension(extension);
                }
            }
            prodcon.setBayeux(bayeux);
        }
    }
View Full Code Here

            this.binding = cometdBinding;
        }

        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,
View Full Code Here

TOP

Related Classes of org.cometd.server.BayeuxServerImpl

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.