String instantiationStrategy = componentDescriptor.getInstantiationStrategy();
if ( instantiationStrategy == null )
{
instantiationStrategy = DEFAULT_INSTANTIATION_STRATEGY;
}
ComponentManagerFactory componentManagerFactory = componentManagerFactories.get( instantiationStrategy );
if ( componentManagerFactory == null )
{
throw new ComponentRepositoryException( "Unsupported instantiation strategy: " + instantiationStrategy,
componentDescriptor );
}
// Get the LifecycleHandler
LifecycleHandler lifecycleHandler;
try
{
lifecycleHandler = lifecycleHandlerManager.getLifecycleHandler( componentDescriptor.getLifecycleHandler() );
}
catch ( UndefinedLifecycleHandlerException e )
{
throw new ComponentRepositoryException( "Undefined lifecycle handler: " + componentDescriptor.getLifecycleHandler(),
componentDescriptor );
}
// Create the ComponentManager
ComponentManager<T> componentManager = componentManagerFactory.createComponentManager( container,
lifecycleHandler,
componentDescriptor );
// Add componentManager to indexe
synchronized ( index )