ComponentRequirement requirementDescriptor,
PropertyDescriptor propertyDescriptor,
PlexusContainer container, ClassRealm lookupRealm )
throws CompositionException
{
Requirement requirement = findRequirement( component,
propertyDescriptor.getPropertyType(),
container,
requirementDescriptor,
lookupRealm );
try
{
Method writeMethod = propertyDescriptor.getWriteMethod();
Object[] params = new Object[1];
params[0] = requirement.getAssignment();
Statement statement = new Statement( component, writeMethod.getName(), params );
statement.execute();
}
catch ( Exception e )
{
reportErrorCannotAssignRequiredComponent( descriptor, requirementDescriptor, e );
}
return requirement.getComponentDescriptors();
}