final ArrayList partitionSet = new ArrayList();
final PartitionTemplate[] partitions = metaData.getPartitions();
for( int i = 0; i < partitions.length; i++ )
{
final PartitionTemplate partition = partitions[i];
final PartitionProfile profile = assembleProfile( partition,
factory );
partitionSet.add( profile );
}
final ArrayList componentSet = new ArrayList();
final ComponentTemplate[] components = metaData.getComponents();
for( int i = 0; i < components.length; i++ )
{
final ComponentTemplate component = components[i];
final ComponentInfo info =
factory.createInfo( component.getImplementationKey() );
final ComponentProfile profile = new ComponentProfile( info,
component );
componentSet.add( profile );
}
final PartitionProfile[] partitionProfiles =
(PartitionProfile[])partitionSet.toArray( new PartitionProfile[partitionSet.size()] );
final ComponentProfile[] componentProfiles =
(ComponentProfile[])componentSet.toArray( new ComponentProfile[componentSet.size()] );
return new PartitionProfile( metaData,
partitionProfiles,
componentProfiles );
}