public synchronized static LdapManager getInstance(final String name) {
        if (instances.containsKey(name)) {
            return instances.get(name);
        } else {
            // the get, put, and remove operations, since those are the only ones used. Using a Map
            // makes it easier to perform LdapManager testing.
            Map<String, String> properties = new Map<String, String>()
            {
                String getKey(Object key) {
                    return getPrefixedPropertyName(name, (String) key);
                }

                @Override
                public String get(Object key)
                {
                    return JiveGlobals.getProperty(getKey(key));
                }

                @Override
                public String put(String key, String value)
                {
                    JiveGlobals.setProperty(getKey(key), value);
                    // Always return null since XMLProperties doesn't support the normal semantics.
                    return null;
                }

                @Override
                public String remove(Object key)
                {
                    JiveGlobals.deleteProperty(getKey(key));
                    // Always return null since XMLProperties doesn't support the normal semantics.
                    return null;
                }


                @Override
                public int size()
                {
                    return 0;
                }

                @Override
                public boolean isEmpty()
                {
                    return false;
                }

                @Override
                public boolean containsKey(Object key)
                {
                    return false;
                }

                @Override
                public boolean containsValue(Object value)
                {
                    return false;
                }

                @Override
                public void putAll(Map<? extends String, ? extends String> t)
                {
                }

                @Override
                public void clear()
                {
                }

                @Override
                public Set<String> keySet()
                {
                    return null;
                }

                @Override
                public Collection<String> values()
                {
                    return null;
                }

                @Override
                public Set<Entry<String, String>> entrySet()
                {
                    return null;
                }
            };
            LdapManager instance = new LdapManager(properties, name);
            instances.put(name, instance);
            return instance;
        }
    }
Provides singleton access to a named instance of the LdapManager class.

This constructor is useful when several, different LDAP configurations are used (eg: A Hybrid Provider that
uses more than one LDAP server).

@param name The name of the ldap instance.
@return an LdapManager instance.
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapManager.java