public Broadcaster createBroadcaster(String ID) { Broadcaster b = BroadcasterFactory.getDefault().get(DefaultBroadcaster.class, ID); atm.setBroadcaster(b); return b; } }
@Override public Broadcaster get(Object id) { return _get().get(id); }
/** * This is the main entrypoint on the server that you will want to hook into and override. * This method is called when a client has request a new connection. Best practice is to do all your * required setup here and tie the AtmosphereResource to a Broadcaster, but do not send anything to * the client yet. If you wish to do so it is best to let the client send a notification to the server * using the {@link AtmosphereClient#post} method in the onConnected event. * * @param resource * @return * @throws ServletException * @throws IOException */ public int doComet(GwtAtmosphereResource resource) throws ServletException, IOException { Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(Broadcaster.class, GWT_BROADCASTER_ID); if (broadcaster == null) { broadcaster = BroadcasterFactory.getDefault().get(DefaultBroadcaster.class, GWT_BROADCASTER_ID); } resource.getAtmosphereResource().setBroadcaster(broadcaster); return NO_TIMEOUT; }
@Override public Broadcaster get() { return _get().get(); }
/** * This is the main entrypoint on the server that you will want to hook into and override. * This method is called when a client has request a new connection. Best practice is to do all your * required setup here and tie the AtmosphereResource to a Broadcaster, but do not send anything to * the client yet. If you wish to do so it is best to let the client send a notification to the server * using the {@link AtmosphereClient#post} method in the onConnected event. * * @param resource * @return * @throws ServletException * @throws IOException */ public int doComet(GwtAtmosphereResource resource) throws ServletException, IOException { Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(Broadcaster.class, GWT_BROADCASTER_ID); if (broadcaster == null) { broadcaster = BroadcasterFactory.getDefault().get(DefaultBroadcaster.class, GWT_BROADCASTER_ID); } resource.getAtmosphereResource().setBroadcaster(broadcaster); return NO_TIMEOUT; }
@Override public <T extends Broadcaster> T get(Class<T> c, Object id) { return _get().get(c, id); }
@Override public void configure(AtmosphereConfig config) { heartbeat = config.getBroadcasterFactory().lookup(DefaultBroadcaster.class, "/swaggersocket.heartbeat"); if (heartbeat == null) { heartbeat = config.getBroadcasterFactory().get(DefaultBroadcaster.class, "/swaggersocket.heartbeat"); } lazywrite = config.getInitParameter("io.swagger.swaggersocket.protocol.lazywrite", false); emptyentity = config.getInitParameter("io.swagger.swaggersocket.protocol.emptyentity", false); String p = config.getInitParameter("io.swagger.swaggersocket.protocol.includedheaders"); if (p != null) { includedheaders = Pattern.compile(p, Pattern.CASE_INSENSITIVE); } p = config.getInitParameter("io.swagger.swaggersocket.protocol.excludedheaders"); if (p != null) { excludedheaders = Pattern.compile(p, Pattern.CASE_INSENSITIVE); } }
public AtmosphereSocket(AtmosphereResource resource) { this.params = params(resource.getRequest().getParameterMap()); this.broadcaster = broadcasterFactory().get(id()).addAtmosphereResource(resource); }
bc = broadcasterFactory.get(id); bc.setScope(Broadcaster.SCOPE.REQUEST); } catch (Exception ex) {