Package org.atmosphere.handler

Examples of org.atmosphere.handler.AbstractReflectorAtmosphereHandler


         *
         * @param handler {@link Handler}
         * @return this
         */
        public Builder resource(String path, final Handler handler) {
            handlers.put(path, new AbstractReflectorAtmosphereHandler() {
                @Override
                public void onRequest(AtmosphereResource resource) throws IOException {
                    handler.handle(resource);
                }

View Full Code Here


        framework.destroy();
    }

    @Test
    public void testQueryStringAsRequest() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

        assertEquals(e2.get().toLowerCase(), "long_polling");
    }

    @Test
    public void testQueryStringBuilder() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

        assertEquals(e.get(), "a=b");
    }

    @Test
    public void testNormalQueryStringBuilder() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

        assertEquals(e.get(), "a=b");
    }

    @Test
    public void testStrinpQueryStringBuilder() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

    }

    @Test
    public void testEncodingOnPreSuspend() throws IOException, ServletException {
        final AtomicReference<AtmosphereResponse> e = new AtomicReference<AtmosphereResponse>();
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
                resource.addEventListener(new AtmosphereResourceEventListenerAdapter() {
                    @Override
                    public void onPreSuspend(AtmosphereResourceEvent event) {
View Full Code Here

    }

    @Test
    public void testRequestBodyString() throws IOException, ServletException {
        final AtomicReference<AtmosphereRequest.Body> e = new AtomicReference<AtmosphereRequest.Body>();
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
                e.set(resource.getRequest().body());
            }
View Full Code Here

    }

    @Test
    public void testRequestBodyBytes() throws IOException, ServletException {
        final AtomicReference<AtmosphereRequest.Body> e = new AtomicReference<AtmosphereRequest.Body>();
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
                e.set(resource.getRequest().body());
            }
View Full Code Here

        });
    }

    @Test
    public void testListenersCallback() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

        assertTrue(broadcasted.get());
    }

    @Test
    public void testOnClose() throws IOException, ServletException {
        framework.addAtmosphereHandler("/a", new AbstractReflectorAtmosphereHandler() {
            @Override
            public void onRequest(AtmosphereResource resource) throws IOException {
            }

            @Override
View Full Code Here

TOP

Related Classes of org.atmosphere.handler.AbstractReflectorAtmosphereHandler

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.