Package org.cometd.server.transport

Examples of org.cometd.server.transport.AbstractHttpTransport$HttpScheduler


        {
            String transportName = _allowedTransports.get(i);
            ServerTransport serverTransport = getTransport(transportName);
            if (serverTransport instanceof AbstractHttpTransport)
            {
                AbstractHttpTransport transport = (AbstractHttpTransport)serverTransport;
                if (transport.accept(request))
                    return transport;
            }
        }
        return null;
    }
View Full Code Here


        {
            serviceOptions(request, response);
            return;
        }

        AbstractHttpTransport transport = _bayeux.findHttpTransport(request);
        if (transport == null)
        {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown Bayeux Transport");
        }
        else
        {
            transport.handle(request, response);
        }
    }
View Full Code Here

    }

    @Test
    public void testMultipleClientSession_WithOneMaxSessionPerBrowser_WithNoMultiSessionInterval() throws Exception
    {
        AbstractHttpTransport transport = (AbstractHttpTransport)bayeux.getTransport("long-polling");
        transport.setOption(AbstractHttpTransport.MAX_SESSIONS_PER_BROWSER_OPTION, 1);
        transport.setOption(AbstractHttpTransport.MULTI_SESSION_INTERVAL_OPTION, 0);
        // Force re-initialization
        transport.init();

        BayeuxClient client1 = newBayeuxClient();
        final ConcurrentLinkedQueue<Message> connects1 = new ConcurrentLinkedQueue<>();
        final CountDownLatch latch1 = new CountDownLatch(2);
        client1.getChannel(Channel.META_CONNECT).addListener(new ClientSessionChannel.MessageListener()
View Full Code Here

    @Test
    public void testMultipleClientSession_WithOneMaxSessionPerBrowser_WithMultiSessionInterval() throws Exception
    {
        long multiSessionInterval = 1500;

        AbstractHttpTransport transport = (AbstractHttpTransport)bayeux.getTransport("long-polling");
        transport.setOption(AbstractHttpTransport.MAX_SESSIONS_PER_BROWSER_OPTION, 1);
        transport.setOption(AbstractHttpTransport.MULTI_SESSION_INTERVAL_OPTION, multiSessionInterval);
        // Force re-initialization
        transport.init();

        BayeuxClient client1 = newBayeuxClient();
        final ConcurrentLinkedQueue<Message> connects1 = new ConcurrentLinkedQueue<>();
        client1.getChannel(Channel.META_CONNECT).addListener(new ClientSessionChannel.MessageListener()
        {
View Full Code Here

    @Test
    public void testMultipleClientSession_WithTwoMaxSessionPerBrowser_WithMultiSessionInterval() throws Exception
    {
        long multiSessionInterval = 1500;

        AbstractHttpTransport transport = (AbstractHttpTransport)bayeux.getTransport("long-polling");
        transport.setOption(AbstractHttpTransport.MAX_SESSIONS_PER_BROWSER_OPTION, 2);
        transport.setOption(AbstractHttpTransport.MULTI_SESSION_INTERVAL_OPTION, multiSessionInterval);
        // Force re-initialization
        transport.init();

        BayeuxClient client1 = newBayeuxClient();
        final ConcurrentLinkedQueue<Message> connects1 = new ConcurrentLinkedQueue<>();
        client1.getChannel(Channel.META_CONNECT).addListener(new ClientSessionChannel.MessageListener()
        {
View Full Code Here

    @Test
    public void testMultipleClientSession_WhenSameClientSendsTwoConnects() throws Exception
    {
        long multiSessionInterval = 1500;

        AbstractHttpTransport transport = (AbstractHttpTransport)bayeux.getTransport("long-polling");
        transport.setOption(AbstractHttpTransport.MAX_SESSIONS_PER_BROWSER_OPTION, 1);
        transport.setOption(AbstractHttpTransport.MULTI_SESSION_INTERVAL_OPTION, multiSessionInterval);
        // Force re-initialization
        transport.init();

        JSONContext.Client parser = new JettyJSONContextClient();

        String handshakeContent = "[{" +
                "\"id\":\"1\"," +
View Full Code Here

        {
            if (Channel.META_HANDSHAKE.equals(message.getChannel()) ||
                Channel.META_CONNECT.equals(message.getChannel()) ||
                Channel.META_DISCONNECT.equals(message.getChannel()))
            {
                AbstractHttpTransport transport = (AbstractHttpTransport)bayeux.getCurrentTransport();
                HttpServletRequest request = transport.getCurrentRequest();
                if (request != null)
                {
                    String uri = request.getRequestURI();
                    message.getExt(true).put("uri", uri);
                }
View Full Code Here

TOP

Related Classes of org.cometd.server.transport.AbstractHttpTransport$HttpScheduler

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.