1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-30 02:02:06 +01:00

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
This commit is contained in:
Matt Tucker 2003-10-23 16:16:53 +00:00 committed by mtucker
parent d4d351aae2
commit f65b410766

View file

@ -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();