private <T> void putCategory(Map<Class<?>, CategoryRegistry> pMap, Class<T> pCategory) { CategoryRegistry<T> registry = new CategoryRegistry<T>(pCategory); pMap.put(pCategory, registry); }
public boolean deregister(final Object pProvider) { checkCategory(pProvider); // NOTE: We remove any provider of the same class, this may or may // not be the same instance as pProvider. T oldProvider = providers.remove(pProvider.getClass()); if (oldProvider != null) { processDeregistration(oldProvider); return true; } return false; }
public boolean register(final T pProvider) { checkCategory(pProvider); // NOTE: We only register the new instance, if we don't already have an instance of pProvider's class. if (!contains(pProvider)) { providers.put(pProvider.getClass(), pProvider); processRegistration(pProvider); return true; } return false; }
Class<T> providerClass = (Class<T>) Class.forName(className, true, pLoader); T provider = providerClass.newInstance(); registry.register(provider);
Class<T> providerClass = (Class<T>) Class.forName(className, true, pLoader); T provider = providerClass.newInstance(); registry.register(provider);
Class<T> providerClass = (Class<T>) Class.forName(className, true, pLoader); T provider = providerClass.newInstance(); registry.register(provider);
/** * Returns an {@code Iterator} containing all providers in the given * category. * <p/> * The iterator supports removal. * <p/> * <small> * NOTE: Removing a provider from the iterator, deregisters the current * provider (as returned by the last invocation of {@code next()}) from * {@code pCategory}, it does <em>not</em> remove the provider * from other categories in the registry. * </small> * * @param pCategory the category class * @return an {@code Iterator} containing all providers in the given * category. * @throws IllegalArgumentException if {@code pCategory} is not a valid * category in this registry */ protected <T> Iterator<T> providers(Class<T> pCategory) { return getRegistry(pCategory).providers(); }
/** * Returns an {@code Iterator} containing all providers in the given * category. * <p/> * The iterator supports removal. * <p/> * <small> * NOTE: Removing a provider from the iterator, deregisters the current * provider (as returned by the last invocation of {@code next()}) from * {@code pCategory}, it does <em>not</em> remove the provider * from other categories in the registry. * </small> * * @param pCategory the category class * @return an {@code Iterator} containing all providers in the given * category. * @throws IllegalArgumentException if {@code pCategory} is not a valid * category in this registry */ protected <T> Iterator<T> providers(Class<T> pCategory) { return getRegistry(pCategory).providers(); }
/** * Returns an {@code Iterator} containing all providers in the given * category. * <p/> * The iterator supports removal. * <p/> * <small> * NOTE: Removing a provider from the iterator, deregisters the current * provider (as returned by the last invocation of {@code next()}) from * {@code pCategory}, it does <em>not</em> remove the provider * from other categories in the registry. * </small> * * @param pCategory the category class * @return an {@code Iterator} containing all providers in the given * category. * @throws IllegalArgumentException if {@code pCategory} is not a valid * category in this registry */ protected <T> Iterator<T> providers(Class<T> pCategory) { return getRegistry(pCategory).providers(); }
private <T> boolean registerImpl(final Object pProvider, final Class<T> pCategory) { return getRegistry(pCategory).register(pCategory.cast(pProvider)); }
private <T> boolean registerImpl(final Object pProvider, final Class<T> pCategory) { return getRegistry(pCategory).register(pCategory.cast(pProvider)); }
private <T> boolean registerImpl(final Object pProvider, final Class<T> pCategory) { return getRegistry(pCategory).register(pCategory.cast(pProvider)); }
private <T> void putCategory(Map<Class<?>, CategoryRegistry> pMap, Class<T> pCategory) { CategoryRegistry<T> registry = new CategoryRegistry<T>(pCategory); pMap.put(pCategory, registry); }
public void remove() { iterator.remove(); processDeregistration(mCurrent); } };
public void remove() { iterator.remove(); processDeregistration(current); } };
private <T> void putCategory(Map<Class<?>, CategoryRegistry> pMap, Class<T> pCategory) { CategoryRegistry<T> registry = new CategoryRegistry<T>(pCategory); pMap.put(pCategory, registry); }
public boolean deregister(final Object pProvider) { checkCategory(pProvider); // NOTE: We remove any provider of the same class, this may or may // not be the same instance as pProvider. T oldProvider = providers.remove(pProvider.getClass()); if (oldProvider != null) { processDeregistration(oldProvider); return true; } return false; }
public boolean deregister(final Object pProvider) { checkCategory(pProvider); // NOTE: We remove any provider of the same class, this may or may // not be the same instance as pProvider. T oldProvider = mProviders.remove(pProvider.getClass()); if (oldProvider != null) { processDeregistration(oldProvider); return true; } return false; }
public boolean deregister(final Object pProvider) { checkCategory(pProvider); // NOTE: We remove any provider of the same class, this may or may // not be the same instance as pProvider. T oldProvider = providers.remove(pProvider.getClass()); if (oldProvider != null) { processDeregistration(oldProvider); return true; } return false; }
public boolean register(final T pProvider) { checkCategory(pProvider); // NOTE: We only register the new instance, if we don't already have an instance of pProvider's class. if (!contains(pProvider)) { providers.put(pProvider.getClass(), pProvider); processRegistration(pProvider); return true; } return false; }