@Test public void voidUnregistration() { TestProviderRegistry registry = new TestProviderRegistry(); registry.unregister(new TestProvider(new ProviderId("of", "foo"))); }
@Override public synchronized void unregister(P provider) { checkNotNull(provider, "Provider cannot be null"); S service = services.get(provider.id()); if (service != null && service instanceof AbstractProviderService) { ((AbstractProviderService) service).invalidate(); services.remove(provider.id()); providers.remove(provider.id()); if (!provider.id().isAncillary()) { providersByScheme.remove(provider.id().scheme()); } } }
AbstractProviderRegistry implements ProviderRegistry<P, S> { @Override public synchronized void unregister(P provider) { checkNotNull(provider, "Provider cannot be null"); S service = services.get(provider.id()); if (service != null && service instanceof AbstractProviderService) { ((AbstractProviderService) service).invalidate(); services.remove(provider.id()); providers.remove(provider.id()); if (!provider.id().isAncillary()) { providersByScheme.remove(provider.id().scheme()); } } } }
AbstractProviderRegistry implements ProviderRegistry<P, S> { @Override public synchronized void unregister(P provider) { checkNotNull(provider, "Provider cannot be null"); S service = services.get(provider.id()); if (service != null && service instanceof AbstractProviderService) { ((AbstractProviderService) service).invalidate(); services.remove(provider.id()); providers.remove(provider.id()); if (!provider.id().isAncillary()) { providersByScheme.remove(provider.id().scheme()); } } }  }
AbstractProviderRegistry implements ProviderRegistry<P, S> { @Override public synchronized void unregister(P provider) { checkNotNull(provider, "Provider cannot be null"); S service = services.get(provider.id()); if (service != null && service instanceof AbstractProviderService) { ((AbstractProviderService) service).invalidate(); services.remove(provider.id()); providers.remove(provider.id()); if (!provider.id().isAncillary()) { providersByScheme.remove(provider.id().scheme()); } } }  @Override synchronized S register(P provider); @Override synchronized void unregister(P provider); @Override synchronized Set<ProviderId> getProviders(); }
AbstractProviderRegistry implements ProviderRegistry<P, S> { @Override public synchronized void unregister(P provider) { checkNotNull(provider, "Provider cannot be null"); S service = services.get(provider.id()); if (service != null && service instanceof AbstractProviderService) { ((AbstractProviderService) service).invalidate(); services.remove(provider.id()); providers.remove(provider.id()); if (!provider.id().isAncillary()) { providersByScheme.remove(provider.id().scheme()); } } }  @Override synchronized S register(P provider); @Override synchronized void unregister(P provider); @Override synchronized Set<ProviderId> getProviders();  }