Package org.atmosphere.client

Examples of org.atmosphere.client.TrackMessageSizeInterceptor$Interceptor


        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Interceptor newInterceptor = new Interceptor( getNewName() );
                interceptors.add( newInterceptor );
                viewer.refresh();
                viewer.setSelection( new StructuredSelection( newInterceptor ) );
                setEditorDirty();
            }
        } );

        deleteButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    interceptors.remove( interceptor );
                    viewer.refresh();
                    setEditorDirty();
                }
            }
        } );

        upButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index > 0 )
                    {
                        Interceptor interceptorBefore = interceptors.get( index - 1 );
                        if ( interceptorBefore != null )
                        {
                            interceptors.set( index - 1, interceptor );
                            interceptors.set( index, interceptorBefore );

                            viewer.refresh();
                            setEditorDirty();
                            enableDisableUpDownButtons();
                        }
                    }
                }
            }
        } );

        downButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
                if ( !selection.isEmpty() )
                {
                    Interceptor interceptor = ( Interceptor ) selection.getFirstElement();

                    int index = interceptors.indexOf( interceptor );
                    if ( index < ( interceptors.size() - 1 ) )
                    {
                        Interceptor interceptorAfter = interceptors.get( index + 1 );
                        if ( interceptorAfter != null )
                        {
                            interceptors.set( index + 1, interceptor );
                            interceptors.set( index, interceptorAfter );
View Full Code Here


        upButton.setEnabled( !selection.isEmpty() );
        downButton.setEnabled( !selection.isEmpty() );
        if ( !selection.isEmpty() )
        {
            Interceptor interceptor = ( Interceptor ) selection.getFirstElement();
            upButton.setEnabled( interceptors.indexOf( interceptor ) != 0 );
            downButton.setEnabled( interceptors.indexOf( interceptor ) != ( interceptors.size() - 1 ) );
        }
    }
View Full Code Here

            try {
                atmosphere.init(vaadinServletConfig);

                // Ensure the client-side knows how to split the message stream
                // into individual messages when using certain transports
                AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();
                trackMessageSize.configure(atmosphere.getAtmosphereConfig());
                atmosphere.interceptor(trackMessageSize);
            } catch (ServletException e) {
                throw new ServiceException("Atmosphere init failed", e);
            }
        }
View Full Code Here

        if (PushContextImpl.class.isAssignableFrom(c.getClass())) {
            framework().asyncSupportListener(PushContextImpl.class.cast(c));
        }

        framework.interceptor(new AtmosphereResourceLifecycleInterceptor())
                .interceptor(new TrackMessageSizeInterceptor())
                .addAnnotationPackage(PushEndpointProcessor.class)
                .objectFactory(new PushObjectFactory());

        EventBusFactory f = new EventBusFactory();
        framework.getAtmosphereConfig().properties().put("evenBus", f.eventBus());
View Full Code Here

    }

    @Override
    public void init(ServletConfig sc) throws ServletException {
        super.init(sc);
        TrackMessageSizeInterceptor t = new TrackMessageSizeInterceptor();
        t.excludedContentType("application/javascript").excludedContentType("text/html").excludedContentType("text/plain").messageDelimiter("<->");
        t.configure(framework().getAtmosphereConfig());
        framework().interceptor(t);
        framework().interceptor(new SwaggerSocketProtocolInterceptor());
        logger.info("Swagger Socket installed {}", Version.getRawVersion());
    }
View Full Code Here

        try {
            atmosphere.init(service.getServlet().getServletConfig());

            // Ensure the client-side knows how to split the message stream
            // into individual messages when using certain transports
            AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();
            trackMessageSize.configure(atmosphere.getAtmosphereConfig());
            atmosphere.interceptor(trackMessageSize);
        } catch (ServletException e) {
            throw new ServiceException("Could not read atmosphere settings", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.atmosphere.client.TrackMessageSizeInterceptor$Interceptor

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.