Package org.cometd.bayeux.server

Examples of org.cometd.bayeux.server.BayeuxServer$Extension$Adapter


        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


        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

        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

public class CometDInitializer extends GenericServlet
{
    public void init() throws ServletException
    {
        BayeuxServer bayeux = (BayeuxServer)getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
        new HelloService(bayeux);
    }
View Full Code Here

    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

        @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

    }

    @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

        _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

    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

        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

TOP

Related Classes of org.cometd.bayeux.server.BayeuxServer$Extension$Adapter

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.