/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Remove Service information from the provider's properties. */ private void serviceInfoFromProperties(Provider.Service s) { super.remove(s.type + "." + s.algorithm); if (s.aliases != null) { for (Iterator<String> i = s.aliases.iterator(); i.hasNext();) { super.remove("Alg.Alias." + s.type + "." + i.next()); } } if (s.attributes != null) { for (Map.Entry<String, String> entry : s.attributes.entrySet()) { super.remove(s.type + "." + s.algorithm + " " + entry.getKey()); } } if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } }
/** * Add Service information to the provider's properties. */ private void serviceInfoToProperties(Provider.Service s) { super.put(s.type + "." + s.algorithm, s.className); if (s.aliases != null) { for (Iterator<String> i = s.aliases.iterator(); i.hasNext();) { super.put("Alg.Alias." + s.type + "." + i.next(), s.algorithm); } } if (s.attributes != null) { for (Map.Entry<String, String> entry : s.attributes.entrySet()) { super.put(s.type + "." + s.algorithm + " " + entry.getKey(), entry.getValue()); } } if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } }
private void myPutAll(Map<?,?> t) { if (changedProperties == null) { changedProperties = new LinkedHashMap<Object, Object>(); } Iterator<? extends Map.Entry<?, ?>> it = t.entrySet().iterator(); Object key; Object value; while (it.hasNext()) { Map.Entry<?, ?> entry = it.next(); key = entry.getKey(); if (key instanceof String && ((String) key).startsWith("Provider.")) { // Provider service type is reserved continue; } value = entry.getValue(); super.put(key, value); if (changedProperties.remove(key) == null) { removeFromPropertyServiceTable(key); } changedProperties.put(key, value); } if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } }
/** * Removes the specified {@code key} and its associated value from this * {@code Provider}. * * @param key * the name of the property * @return the value that was mapped to the specified {@code key} ,or * {@code null} if no mapping was present */ @Override public synchronized Object remove(Object key) { if (key instanceof String && ((String) key).startsWith("Provider.")) { // Provider service type is reserved return null; } if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } if (changedProperties != null && changedProperties.remove(key) == null) { removeFromPropertyServiceTable(key); if (changedProperties.size() == 0) { changedProperties = null; } } return super.remove(key); }
/** * Maps the specified {@code key} property name to the specified {@code * value}. * * @param key * the name of the property. * @param value * the value of the property. * @return the value that was previously mapped to the specified {@code key} * ,or {@code null} if it did not have one. */ @Override public synchronized Object put(Object key, Object value) { if (key instanceof String && ((String) key).startsWith("Provider.")) { // Provider service type is reserved return null; } if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } if (changedProperties != null && changedProperties.remove(key) == null) { removeFromPropertyServiceTable(key); } if (changedProperties == null) { changedProperties = new LinkedHashMap<Object, Object>(); } changedProperties.put(key, value); return super.put(key, value); }
/** * Clears all properties used to look up services implemented by this * {@code Provider}. */ @Override public synchronized void clear() { super.clear(); if (serviceTable != null) { serviceTable.clear(); } if (propertyServiceTable != null) { propertyServiceTable.clear(); } if (aliasTable != null) { aliasTable.clear(); } if (propertyAliasTable != null) { propertyAliasTable.clear(); } changedProperties = null; putProviderInfo(); if (providerNumber != -1) { // if registered then refresh Services Services.setNeedRefresh(); } servicesChanged(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Removes the provider at the specified 1-based position. */ public static synchronized void removeProvider(int providerNumber) { Provider p = providers.remove(providerNumber - 1); providersNames.remove(p.getName()); setNeedRefresh(); }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }
/** * Inserts a provider at a specified 1-based position. */ public static synchronized int insertProviderAt(Provider provider, int position) { int size = providers.size(); if ((position < 1) || (position > size)) { position = size + 1; } providers.add(position - 1, provider); providersNames.put(provider.getName(), provider); setNeedRefresh(); return position; }