Iterator i = factoryCfg.getStartupConfiguration().getContextPartitionConfigurations().iterator();
try
{
while( i.hasNext() )
{
DirectoryPartitionConfiguration c = ( DirectoryPartitionConfiguration ) i.next();
addContextPartition( c );
initializedPartitionCfgs.add( 0, c );
}
initialized = true;
}
finally
{
if( !initialized )
{
i = initializedPartitionCfgs.iterator();
while( i.hasNext() )
{
DirectoryPartitionConfiguration partitionCfg =
( DirectoryPartitionConfiguration ) i.next();
DirectoryPartition partition = partitionCfg.getContextPartition();
i.remove();
try
{
partition.destroy();
}
catch( Exception e )
{
log.warn(
"Failed to destroy a partition: " +
partitionCfg.getSuffix(), e );
}
finally
{
unregister( partition );
}