From 96796a82b4c21b5a4b44134230bf37977734bd62 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Fri, 27 Jan 2006 18:44:17 +0000 Subject: [PATCH] Added methods to remove providers (SMACK-118). git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3381 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smack/provider/ProviderManager.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/org/jivesoftware/smack/provider/ProviderManager.java b/source/org/jivesoftware/smack/provider/ProviderManager.java index 2a97f4068..f7cd792da 100644 --- a/source/org/jivesoftware/smack/provider/ProviderManager.java +++ b/source/org/jivesoftware/smack/provider/ProviderManager.java @@ -274,6 +274,19 @@ public class ProviderManager { iqProviders.put(key, provider); } + /** + * Removes an IQ provider with the specified element name and namespace. This + * method is typically called to cleanup providers that are programatically added + * using the {@link #addIQProvider(String, String, Object) addIQProvider} method. + * + * @param elementName the XML element name. + * @param namespace the XML namespace. + */ + public static void removeIQProvider(String elementName, String namespace) { + String key = getProviderKey(elementName, namespace); + iqProviders.remove(key); + } + /** * Returns the packet extension provider registered to the specified XML element name * and namespace. For example, if a provider was registered to the element name "x" and the @@ -318,6 +331,19 @@ public class ProviderManager { extensionProviders.put(key, provider); } + /** + * Removes an extension provider with the specified element name and namespace. This + * method is typically called to cleanup providers that are programatically added + * using the {@link #addExtensionProvider(String, String, Object) addExtensionProvider} method. + * + * @param elementName the XML element name. + * @param namespace the XML namespace. + */ + public static void removeExtensionProvider(String elementName, String namespace) { + String key = getProviderKey(elementName, namespace); + extensionProviders.remove(key); + } + /** * Returns an Iterator for all PacketExtensionProvider instances. *