public synchronized void destroy() { if ( !initialized ) { return; } Iterator suffixes = new HashSet( this.partitions.keySet() ).iterator(); // make sure this loop is not fail fast so all backing stores can // have an attempt at closing down and synching their cached entries while ( suffixes.hasNext() ) { String suffix = ( String ) suffixes.next(); try { removeContextPartition( new LdapDN( suffix ) ); } catch ( NamingException e ) { log.warn( "Failed to destroy a partition: " + suffix, e ); } } initialized = false; }