Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.AtmosphereHandler


        final CountDownLatch l = new CountDownLatch(1);

        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    private final AtomicBoolean b = new AtomicBoolean(false);

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
View Full Code Here


    @Test(enabled = true)
    public void serializeFutureGetTest() throws Exception {
        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    private final AtomicInteger count = new AtomicInteger(1);

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
View Full Code Here

    @Test
    public void ahcCloseTest() throws IOException, InterruptedException {
        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    private final AtomicBoolean b = new AtomicBoolean(false);

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
View Full Code Here

        final CountDownLatch closedLatch = new CountDownLatch(1);

        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
                        r.addEventListener(new AtmosphereResourceEventListenerAdapter() {
                            @Override
View Full Code Here

        final CountDownLatch openedLatch = new CountDownLatch(1);

        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
                        r.addEventListener(new AtmosphereResourceEventListenerAdapter() {
                            @Override
View Full Code Here

    @Test
    public void ahcCloseTest2() throws IOException, InterruptedException {
        Config config = new Config.Builder()
                .port(port)
                .host("127.0.0.1")
                .resource("/suspend", new AtmosphereHandler() {

                    private final AtomicBoolean b = new AtomicBoolean(false);

                    @Override
                    public void onRequest(AtmosphereResource r) throws IOException {
View Full Code Here

            Class<?> aClass = annotatedClass;
            PushEndpoint a = aClass.getAnnotation(PushEndpoint.class);
            List<AtmosphereInterceptor> l = new ArrayList<AtmosphereInterceptor>();

            Object c = framework.newClassInstance(Object.class, aClass);
            AtmosphereHandler handler = framework.newClassInstance(PushEndpointHandlerProxy.class, PushEndpointHandlerProxy.class).configure(framework.getAtmosphereConfig(), c);
            l.add(framework.newClassInstance(AtmosphereInterceptor.class, PushEndpointInterceptor.class));

            Class<? extends Broadcaster> b = (Class<? extends Broadcaster>) IOUtils.loadClass(this.getClass(), framework.getDefaultBroadcasterClassName());

            framework.addAtmosphereHandler(a.value(), handler, broadcaster(framework, b, a.value()), l);
View Full Code Here

                String mapping = a.path();

                AnnotationUtil.interceptors(framework, a.interceptors(), l);

                if (!a.dispatch()) {
                    AtmosphereHandler proxy = new AtmosphereServletProcessor() {

                        private String method = "GET";

                        @Override
                        public void onRequest(AtmosphereResource resource) throws IOException {
View Full Code Here

                l.add(aa);
            }

            framework.sessionSupport(a.supportSession());

            AtmosphereHandler handler = framework.newClassInstance(AtmosphereHandler.class, annotatedClass);
            for (String s : a.properties()) {
                String[] nv = s.split("=");
                IntrospectionUtils.setProperty(handler, nv[0], nv[1]);
                IntrospectionUtils.addProperty(handler, nv[0], nv[1]);
            }
View Full Code Here

            if (aa != null) {
                l.add(aa);
            }

            Object c = framework.newClassInstance(Object.class, aClass);
            AtmosphereHandler handler = framework.newClassInstance(ManagedAtmosphereHandler.class,
                    ManagedAtmosphereHandler.class).configure(framework.getAtmosphereConfig(), c);
            // MUST BE ADDED FIRST, ALWAYS!
            l.add(framework.newClassInstance(AtmosphereInterceptor.class, ManagedServiceInterceptor.class));

            framework.filterManipulator(new BroadcasterConfig.FilterManipulator() {
View Full Code Here

TOP

Related Classes of org.atmosphere.cpr.AtmosphereHandler

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.