Examples of BayeuxServer


Examples of org.cometd.bayeux.server.BayeuxServer

  }

  @Provides
  @Singleton
  public UpdateManager getUpdateManager(Injector injector) {
    BayeuxServer bayeuxServer = injector.getInstance(BayeuxServer.class);
    UpdateManager updateManager = new UpdateManager(bayeuxServer);
    updateManager.addUpdaterFactory(new ObservableUpdaterFactory());
    return updateManager;
  }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        this.unregister();
    }

    private void register(CometdService cometdService) {
        try {
            BayeuxServer bayeuxServer = cometdService.getBayeuxServer();
            if (bayeuxServer != null) {
                Hashtable<String, String> props = new Hashtable<String, String>();
                props.put("alias", "/system/time");
                // whiteboard servlet registration
                this.reg = context.registerService(Servlet.class.getName(), new TimeServlet(bayeuxServer), props);
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    @Override
    protected void doStart() throws Exception
    {
        session.handshake();
        BayeuxServer bayeuxServer = oort.getBayeuxServer();
        bayeuxServer.createChannelIfAbsent(forwardChannelName).getReference().addListener(this);
        bayeuxServer.createChannelIfAbsent(broadcastChannelName).getReference().addListener(this);
        bayeuxServer.createChannelIfAbsent(resultChannelName).getReference().addListener(this);
        oort.observeChannel(broadcastChannelName);
        if (logger.isDebugEnabled())
            logger.debug("Started {}", this);
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    @Override
    protected void doStop() throws Exception
    {
        oort.deobserveChannel(broadcastChannelName);
        BayeuxServer bayeuxServer = oort.getBayeuxServer();
        ServerChannel channel = bayeuxServer.getChannel(resultChannelName);
        if (channel != null)
            channel.removeListener(this);
        channel = bayeuxServer.getChannel(broadcastChannelName);
        if (channel != null)
            channel.removeListener(this);
        channel = bayeuxServer.getChannel(forwardChannelName);
        if (channel != null)
            channel.removeListener(this);
        session.disconnect();
        if (logger.isDebugEnabled())
            logger.debug("Stopped {}", this);
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        context.addServlet(cometdServletHolder, cometdURLMapping);

        server.start();
        String url = "http://localhost:" + connector.getLocalPort() + cometdServletPath;
        server.setAttribute(OortConfigServlet.OORT_URL_PARAM, url);
        BayeuxServer bayeux = (BayeuxServer)context.getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
        server.setAttribute(BayeuxServer.ATTRIBUTE, bayeux);

        servers.add(server);

        return server;
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    }

    protected Oort startOort(Server server) throws Exception
    {
        String url = (String)server.getAttribute(OortConfigServlet.OORT_URL_PARAM);
        final BayeuxServer bayeuxServer = (BayeuxServer)server.getAttribute(BayeuxServer.ATTRIBUTE);
        Oort oort = new Oort(bayeuxServer, url);
        oort.start();
        oorts.add(oort);
        return oort;
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        configurers.add(configurerA);
        configurerA.start();

        Server serverB = startServer(0);
        String wrongURL = "http://localhost:4/cometd";
        BayeuxServer bayeuxServerB = (BayeuxServer)serverB.getAttribute(BayeuxServer.ATTRIBUTE);
        Oort oortB = new Oort(bayeuxServerB, wrongURL);
        oortB.start();

        OortMulticastConfigurer configurerB = new OortMulticastConfigurer(oortB);
        configurerB.setGroupPort(groupPort);
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        data.put(Info.TYPE_FIELD, TYPE_FIELD_ENTRY_VALUE);
        data.put(Info.ACTION_FIELD, ACTION_FIELD_PUT_ABSENT_VALUE);

        if (logger.isDebugEnabled())
            logger.debug("Sharing map putIfAbsent {}", data);
        BayeuxServer bayeuxServer = getOort().getBayeuxServer();
        bayeuxServer.getChannel(getChannelName()).publish(getLocalSession(), data);

        return data.getResult();
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        data.put(Info.TYPE_FIELD, TYPE_FIELD_ENTRY_VALUE);
        data.put(Info.ACTION_FIELD, ACTION_FIELD_REMOVE_VALUE);

        if (logger.isDebugEnabled())
            logger.debug("Sharing map remove {}", data);
        BayeuxServer bayeuxServer = getOort().getBayeuxServer();
        bayeuxServer.getChannel(getChannelName()).publish(getLocalSession(), data);

        return data.getResult();
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

public class CometDInitializer extends GenericServlet
{
    public void init() throws ServletException
    {
        BayeuxServer bayeux = (BayeuxServer)getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
        new HelloService(bayeux);
    }
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.