From f65b410766b9f95ce42a599872e2f79afd9a39b3 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Thu, 23 Oct 2003 16:16:53 +0000 Subject: [PATCH] Added methods to get Iterators for IQ and PacketExtension providers. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2155 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smack/provider/ProviderManager.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/org/jivesoftware/smack/provider/ProviderManager.java b/source/org/jivesoftware/smack/provider/ProviderManager.java index 63e8d4463..4fd67bf32 100644 --- a/source/org/jivesoftware/smack/provider/ProviderManager.java +++ b/source/org/jivesoftware/smack/provider/ProviderManager.java @@ -274,6 +274,15 @@ public class ProviderManager { return iqProviders.get(key); } + /** + * Returns an Iterator for all IQProvider instances. + * + * @return an Iterator for all IQProvider instances. + */ + public static Iterator getIQProviders() { + return Collections.unmodifiableCollection(new HashMap(iqProviders).values()).iterator(); + } + /** * Adds an IQ provider (must be an instance of IQProvider or Class object that is an IQ) * with the specified element name and name space. The provider will override any providers @@ -340,6 +349,16 @@ public class ProviderManager { extensionProviders.put(key, provider); } + /** + * Returns an Iterator for all PacketExtensionProvider instances. + * + * @return an Iterator for all PacketExtensionProvider instances. + */ + public static Iterator getExtensionProviders() { + return Collections.unmodifiableCollection( + new HashMap(extensionProviders).values()).iterator(); + } + /** * Returns a String key for a given element name and namespace. * @@ -353,6 +372,11 @@ public class ProviderManager { return buf.toString(); } + /** + * Returns an array of class loaders to load resources from. + * + * @return an array of ClassLoader instances. + */ private static ClassLoader[] getClassLoaders() { ClassLoader[] classLoaders = new ClassLoader[3]; classLoaders[0] = new ProviderManager().getClass().getClassLoader();