@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullListeners() throws Exception { listener.registerListener(TENANT_ID, null); }
public void registerListener(String tenantId, L listener) { hasText(tenantId); notNull(listener); final Set<L> listeners; if (registeredListener.containsKey(tenantId)) { listeners = registeredListener.get(tenantId); } else { listeners = new WeakHashSet(); registeredListener.put(tenantId, listeners); } listeners.add(listener); }
EventDistributor extends AbstractEventListener<T> { public void registerListener(String tenantId, L listener) { hasText(tenantId); notNull(listener); final Set<L> listeners; if (registeredListener.containsKey(tenantId)) { listeners = registeredListener.get(tenantId); } else { listeners = new WeakHashSet(); registeredListener.put(tenantId, listeners); } listeners.add(listener); } }
EventDistributor extends AbstractEventListener<T> { public void registerListener(String tenantId, L listener) { hasText(tenantId); notNull(listener); final Set<L> listeners; if (registeredListener.containsKey(tenantId)) { listeners = registeredListener.get(tenantId); } else { listeners = new WeakHashSet(); registeredListener.put(tenantId, listeners); } listeners.add(listener); } EventDistributor(ClusterService clusterService,
                            TenantService tenantService); }
EventDistributor extends AbstractEventListener<T> { public void registerListener(String tenantId, L listener) { hasText(tenantId); notNull(listener); final Set<L> listeners; if (registeredListener.containsKey(tenantId)) { listeners = registeredListener.get(tenantId); } else { listeners = new WeakHashSet(); registeredListener.put(tenantId, listeners); } listeners.add(listener); } EventDistributor(ClusterService clusterService,
                            TenantService tenantService); void registerListener(String tenantId, L listener); void unregisterListener(L listener); boolean isListenerRegistered(L listener); @Override void setClusterService(ClusterService clusterService); @Override void setTenantService(TenantService tenantService); }
EventDistributor extends AbstractEventListener<T> { public void registerListener(String tenantId, L listener) { hasText(tenantId); notNull(listener); final Set<L> listeners; if (registeredListener.containsKey(tenantId)) { listeners = registeredListener.get(tenantId); } else { listeners = new WeakHashSet(); registeredListener.put(tenantId, listeners); } listeners.add(listener); } EventDistributor(ClusterService clusterService,
                            TenantService tenantService); void registerListener(String tenantId, L listener); void unregisterListener(L listener); boolean isListenerRegistered(L listener); @Override void setClusterService(ClusterService clusterService); @Override void setTenantService(TenantService tenantService);  }