@Test public void testRemove() { String id = "id"; String id2 = "foo"; Broadcaster b = factory.get(id); Broadcaster b2 = factory.get(id2); assert factory.remove(b, id2) == false; assert factory.remove(b2, id) == false; assert factory.remove(b, id) == true; assert factory.lookup(id) == null; }
@Override public boolean remove(Broadcaster b, Object id) { boolean removed = store.remove(id, b); if (removed && logger.isDebugEnabled()) { logger.debug("Removing Broadcaster {} factory size now {} ", id, store.size()); } return removed; }
DefaultBroadcasterFactory implements BroadcasterFactory { @Override public boolean remove(Broadcaster b, Object id) { boolean removed = store.remove(id, b); if (removed && logger.isDebugEnabled()) { logger.debug("Removing Broadcaster {} factory size now {} ", id, store.size()); } return removed; } }
DefaultBroadcasterFactory implements BroadcasterFactory { @Override public boolean remove(Broadcaster b, Object id) { boolean removed = store.remove(id, b); if (removed && logger.isDebugEnabled()) { logger.debug("Removing Broadcaster {} factory size now {} ", id, store.size()); } return removed; } DefaultBroadcasterFactory(); @Deprecated  DefaultBroadcasterFactory(Class<? extends Broadcaster> clazz, String broadcasterLifeCyclePolicy, AtmosphereConfig c); }
DefaultBroadcasterFactory implements BroadcasterFactory { @Override public boolean remove(Broadcaster b, Object id) { boolean removed = store.remove(id, b); if (removed && logger.isDebugEnabled()) { logger.debug("Removing Broadcaster {} factory size now {} ", id, store.size()); } return removed; } DefaultBroadcasterFactory(); @Deprecated  DefaultBroadcasterFactory(Class<? extends Broadcaster> clazz, String broadcasterLifeCyclePolicy, AtmosphereConfig c); void configure(Class<? extends Broadcaster> clazz, String broadcasterLifeCyclePolicy, AtmosphereConfig c); @Override synchronized Broadcaster get(); @Override Broadcaster get(Object id); @Override T get(Class<T> c, Object id); @Override boolean add(Broadcaster b, Object id); @Override boolean remove(Broadcaster b, Object id); @Override T lookup(Class<T> c, Object id); @Override Broadcaster lookup(Object id); @Override Broadcaster lookup(Object id, boolean createIfNull); @Override T lookup(Class<T> c, Object id, boolean createIfNull); T lookup(Class<T> c, Object id, boolean createIfNull, boolean unique); @Deprecated @Override void removeAllAtmosphereResource(AtmosphereResource r); @Override boolean remove(Object id); @Override Collection<Broadcaster> lookupAll(); @Override synchronized void destroy(); void notifyOnPostCreate(Broadcaster b); @Override BroadcasterFactory addBroadcasterListener(BroadcasterListener l); @Override BroadcasterFactory removeBroadcasterListener(BroadcasterListener l); @Override Collection<BroadcasterListener> broadcasterListeners(); }
DefaultBroadcasterFactory implements BroadcasterFactory { @Override public boolean remove(Broadcaster b, Object id) { boolean removed = store.remove(id, b); if (removed && logger.isDebugEnabled()) { logger.debug("Removing Broadcaster {} factory size now {} ", id, store.size()); } return removed; } DefaultBroadcasterFactory(); @Deprecated  DefaultBroadcasterFactory(Class<? extends Broadcaster> clazz, String broadcasterLifeCyclePolicy, AtmosphereConfig c); void configure(Class<? extends Broadcaster> clazz, String broadcasterLifeCyclePolicy, AtmosphereConfig c); @Override synchronized Broadcaster get(); @Override Broadcaster get(Object id); @Override T get(Class<T> c, Object id); @Override boolean add(Broadcaster b, Object id); @Override boolean remove(Broadcaster b, Object id); @Override T lookup(Class<T> c, Object id); @Override Broadcaster lookup(Object id); @Override Broadcaster lookup(Object id, boolean createIfNull); @Override T lookup(Class<T> c, Object id, boolean createIfNull); T lookup(Class<T> c, Object id, boolean createIfNull, boolean unique); @Deprecated @Override void removeAllAtmosphereResource(AtmosphereResource r); @Override boolean remove(Object id); @Override Collection<Broadcaster> lookupAll(); @Override synchronized void destroy(); void notifyOnPostCreate(Broadcaster b); @Override BroadcasterFactory addBroadcasterListener(BroadcasterListener l); @Override BroadcasterFactory removeBroadcasterListener(BroadcasterListener l); @Override Collection<BroadcasterListener> broadcasterListeners(); static final URI legacyBroadcasterURI; }