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

    @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

Examples of org.atmosphere.jersey.Broadcastable

    }

    @GET
    @Suspend (period = 5000, outputComments = false)
    public Broadcastable subscribe() {
        return new Broadcastable("resume", broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

    @GET
    @Path("withComments")
    @Suspend (period = 5000, outputComments = true)
    public Broadcastable subscribeWithComments() {
        return new Broadcastable(broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

    @GET
    @Path("forever")
    @Suspend (outputComments = true)
    public Broadcastable suspendForever() {
        return new Broadcastable(broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

    @GET
    @Path("foreverWithoutComments")
    @Suspend (outputComments = false)
    public Broadcastable suspendForeverWithoutComments() {
        return new Broadcastable(broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     */
    @GET
    @Suspend(resumeOnBroadcast=true, outputComments = false)
    @Path("subscribeAndResume")
    public Broadcastable subscribeAndResume() {
        return new Broadcastable(broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

     * Create a new {@link org.atmosphere.jersey.Broadcastable}.
     * @param m
     * @return
     */
    Broadcastable broadcast(String m){
       return new Broadcastable(m + "\n", broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

        Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(DefaultBroadcaster.class, topic, true);
        logger.info("thread: {} LISTENING to '{}'", Thread.currentThread().getName(), broadcaster.getID());
        if (service == null) {
            throw new AssertionError();
        }
        return new Broadcastable(new JSONObject().put("from", "system").put("msg", "Connected !"), broadcaster);
    }
View Full Code Here

Examples of org.atmosphere.jersey.Broadcastable

        logger.info("thread: {} PUBLISH to '{}' from {}: {}",
                new Object[]{Thread.currentThread().getName(), broadcaster.getID(), from, message});
        if (service == null) {
            throw new AssertionError();
        }
        return new Broadcastable(new JSONObject().put("from", from).put("msg", message), "", broadcaster);
    }
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.