Examples of BayeuxServer


Examples of org.cometd.bayeux.server.BayeuxServer

    public void init(ServletConfig config) throws ServletException
    {
        super.init(config);

        ServletContext servletContext = config.getServletContext();
        BayeuxServer bayeux = (BayeuxServer)servletContext.getAttribute(BayeuxServer.ATTRIBUTE);
        if (bayeux == null)
            throw new UnavailableException("Missing " + BayeuxServer.ATTRIBUTE + " attribute");

        String url = provideOortURL();
        if (url == null)
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        @Override
        public void init() throws ServletException
        {
            mbeanContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
            BayeuxServer bayeuxServer = (BayeuxServer)getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
            mbeanContainer.beanAdded(null, bayeuxServer);
            mbeans.add(bayeuxServer);
            // Add other components
        }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    }

    @Override
    protected void doStart() throws Exception
    {
        BayeuxServer bayeux = _oort.getBayeuxServer();

        _session.handshake();

        bayeux.createChannelIfAbsent(SETI_ALL_CHANNEL).getReference().setPersistent(true);
        _oort.observeChannel(SETI_ALL_CHANNEL);
        _session.getChannel(SETI_ALL_CHANNEL).subscribe(new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                receiveBroadcast(message);
            }
        });

        String setiChannel = generateSetiChannel(_setiId);
        bayeux.createChannelIfAbsent(setiChannel).getReference().setPersistent(true);
        _session.getChannel(setiChannel).subscribe(new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                receiveDirect(message);
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        _oort.removeCometListener(_cometListener);

        String setiChannel = generateSetiChannel(_setiId);
        _oort.deobserveChannel(setiChannel);

        BayeuxServer bayeux = _oort.getBayeuxServer();
        ServerChannel channel = bayeux.getChannel(setiChannel);
        if (channel != null)
            channel.setPersistent(false);

        _oort.deobserveChannel(SETI_ALL_CHANNEL);
        channel = bayeux.getChannel(SETI_ALL_CHANNEL);
        if (channel != null)
            channel.setPersistent(false);
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    private ServerAnnotationProcessor processor;

    @PostConstruct
    private void init()
    {
        BayeuxServer bayeuxServer = bayeuxServer();
        bayeuxServer.setSecurityPolicy(policy());
        this.processor = new ServerAnnotationProcessor(bayeuxServer);

        // Link the cloud, or use OortMulticastConfigurer.
        Oort oort = oort();
//        oort.observeComet("http://cloud.cometd.org/cometd");
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        if (logger.isDebugEnabled())
            logger.debug("Set local {}", info);

        sender.handshake();
        oort.addCometListener(this);
        BayeuxServer bayeuxServer = oort.getBayeuxServer();
        ServerChannel channel = bayeuxServer.createChannelIfAbsent(channelName, this).getReference();
        channel.addListener(messageListener);
        oort.observeChannel(channelName);

        // Notify other nodes of our initial value.
        // Must be done after registering listeners, to avoid missing responses from other nodes.
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

        data.put(Info.NAME_FIELD, getName());
        data.put(Info.OBJECT_FIELD, serialize(newObject));

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

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

Examples of org.cometd.bayeux.server.BayeuxServer

        assertNotNull(service);
        Seti seti = service.seti;
        assertNotNull(seti);
        Oort oort = seti.getOort();
        assertNotNull(oort);
        BayeuxServer bayeux = oort.getBayeuxServer();
        assertNotNull(bayeux);

        SecurityPolicy policy = bayeux.getSecurityPolicy();
        assertNotNull(policy);
        assertTrue(policy instanceof OortSecurityPolicy);

        server.stop();
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    {
        super.init(config);

        ServletContext context = config.getServletContext();

        BayeuxServer bayeux = (BayeuxServer)context.getAttribute(BayeuxServer.ATTRIBUTE);
        Oort oort = (Oort)context.getAttribute(Oort.OORT_ATTRIBUTE);
        Seti seti = (Seti)context.getAttribute(Seti.SETI_ATTRIBUTE);

        _processor = new ServerAnnotationProcessor(bayeux, oort, seti);
        _service = new OortChatService();
        _processor.process(_service);

        bayeux.addExtension(new TimesyncExtension());
    }
View Full Code Here

Examples of org.cometd.bayeux.server.BayeuxServer

    @Test
    public void testObserveNonStartedOortAndDetectStart() throws Exception
    {
        Server server1 = startServer(0);
        String url = (String)server1.getAttribute(OortConfigServlet.OORT_URL_PARAM);
        final BayeuxServer bayeuxServer = (BayeuxServer)server1.getAttribute(BayeuxServer.ATTRIBUTE);
        Oort oort1 = new Oort(bayeuxServer, url);
        oort1.start();

        Server server2 = startServer(0);
        String url2 = (String)server2.getAttribute(OortConfigServlet.OORT_URL_PARAM);
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.