protected void verifyDependencyReferences(
final ComponentProfile component,
final ComponentProfile[] others )
throws Exception
{
final ComponentInfo info = component.getInfo();
final DependencyDirective[] dependencies = component.getTemplate()
.getDependencies();
for( int i = 0; i < dependencies.length; i++ )
{
final DependencyDirective dependency = dependencies[ i ];
final String providerName = dependency.getProviderName();
final String key = dependency.getKey();
final String type = info.getDependency( key ).getComponentType();
//Get the other component that is providing service
final ComponentProfile provider = getComponentProfile(
providerName, others );
if( null == provider )
{
final String message =
REZ.format( "assembly.missing-dependency.error",
key,
providerName,
component.getTemplate().getName() );
throw new Exception( message );
}
//make sure that the component offers service
//that user expects it to be providing
final ComponentInfo providerInfo = provider.getInfo();
final ServiceDescriptor[] services = providerInfo.getServices();
if( !hasMatchingService( type, services ) )
{
final String message =
REZ.format( "assembly.dependency-missing-service.error",
providerName,