private synchronized <T> ComponentManager<T> getComponentManager( Class<T> type, String role, String roleHint, ComponentDescriptor<T> descriptor )
throws ComponentLookupException
{
if ( disposingComponents )
{
throw new ComponentLookupException("ComponentRegistry is not active",
role,
roleHint );
}
ComponentManager<T> componentManager = getComponentManager( type, role, roleHint );
if ( componentManager == null )
{
// we need to create a component manager, but first we must have a descriptor
if ( descriptor == null )
{
descriptor = getComponentDescriptor( type, role, roleHint );
if ( descriptor == null )
{
throw new ComponentLookupException(
"Component descriptor cannot be found in the component repository",
role,
roleHint );
}
}