Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.BroadcasterFactory.lookup()


                            (AtmosphereResource<HttpServletRequest, HttpServletResponse>)
                                    req.getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE);
                    BroadcasterFactory bp = (BroadcasterFactory)
                            req.getAttribute(AtmosphereServlet.BROADCASTER_FACTORY);

                    broadcaster = bp.lookup(r.getBroadcaster().getClass(), topic, true);
                } catch (Throwable ex) {
                    throw new WebApplicationException(ex);
                }
                req.setAttribute(AtmosphereFilter.INJECTED_BROADCASTER, broadcaster);
                return broadcaster;
View Full Code Here


                    try {
                        c = (Class<Broadcaster>) Class.forName((String) req.getAttribute(ApplicationConfig.BROADCASTER_CLASS));
                    } catch (Throwable e) {
                        throw new IllegalStateException(e.getMessage());
                    }
                    broadcaster = bp.lookup(c, topic, true);
                } catch (Throwable ex) {
                    throw new WebApplicationException(ex);
                }
                logger.trace("Injected Broadcaster {}", broadcaster);
                req.setAttribute(AtmosphereFilter.INJECTED_BROADCASTER, broadcaster);
View Full Code Here

    BroadcasterFactory broadcasterFactory = BroadcasterFactory.getDefault();
    if (broadcasterFactory == null) {
      return;
    }

    Broadcaster b = broadcasterFactory.lookup("changes", true);
    if (b != null) {
      b.broadcast(data);
    }
  }
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.