Examples of Broadcastable


Examples of org.atmosphere.jersey.Broadcastable

    }

    @POST
    @Broadcast
    public Broadcastable publish(@FormParam("message") String message) {
        return new Broadcastable(message, "", topic);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

            throw new WebApplicationException(400);
        }

        bc.setID(name);
        String m = BEGIN_SCRIPT_TAG + toJsonp("Welcome back", name) + END_SCRIPT_TAG;
        Broadcastable b = new Broadcastable(m, bc);
        return b;
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

        UserStateData followeeData = us.get(followee);
        TwitterBroadcaster outsiderBroadcaster = followeeData.bc;
        if (outsiderBroadcaster == null) {
            String m = (BEGIN_SCRIPT_TAG + toJsonp("Invalid Twitter user ", followee) + END_SCRIPT_TAG);
            Broadcastable b = new Broadcastable(m, userBc);
            return b;
        }

        outsiderBroadcaster.broadcast(BEGIN_SCRIPT_TAG
                        + toJsonp(name, " is now following " + followee)
                        + END_SCRIPT_TAG);

        outsiderBroadcaster.addAtmosphereResource(userBc.getUserAtmosphereEvent().getResource());

        String m = (BEGIN_SCRIPT_TAG
                        + toJsonp("You are now following ", followee)
                        + END_SCRIPT_TAG);
        Broadcastable b = new Broadcastable(m, userBc);
        return b;
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

        }

        String m = "<script id='comet_" + counter++ + "'>" + "window.parent."
                + callback + "(" + message + ");</script>";

        Broadcastable b = new Broadcastable(m, bc);
        return b;
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

    }
   
    @Suspend
    @GET
    public Broadcastable get() {
        return new Broadcastable(getTimerBroadcaster());
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     * @return A {@link Broadcastable} used to broadcast events.
     */
    @GET
    @Suspend(listeners = {EventsLogger.class})
    public Broadcastable subscribe() {
        return new Broadcastable(topic);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     */
    @GET
    @Suspend(resumeOnBroadcast = true, listeners = {EventsLogger.class})
    @Path("subscribeAndResume")
    public Broadcastable subscribeAndResume() {
        return new Broadcastable(topic);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     */
    @POST
    @Produces("application/xml")
    @Broadcast
    public Broadcastable publishWithXML(@FormParam("message") String message) {
        return new Broadcastable(new JAXBBean(message), topic);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     *
     * @param m
     * @return
     */
    Broadcastable broadcast(String m) {
        return new Broadcastable(m + "\n", topic);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

    @GET
    @Path("scope")
    @Suspend (period = 5000, outputComments = false, scope = Suspend.SCOPE.REQUEST, resumeOnBroadcast = true)
    public Broadcastable suspendScopeRequest(@PathParam("topic") Broadcaster b) throws ExecutionException, InterruptedException {
        b.broadcast("foo").get();
        return new Broadcastable("bar",b);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.