void complete(DynamicConfiguration configuration, HK2Loader defaultLoader) {
if (this.loader == null) {
this.loader = defaultLoader;
}
ActiveDescriptorBuilder factoryDescriptorBuilder = BuilderHelper.activeLink(factoryClass)
.named(name)
.andLoadWith(this.loader)
.analyzeWith(this.analyzer);
if (factoryScope != null) {
factoryDescriptorBuilder.in(factoryScope);
}
ActiveDescriptorBuilder descriptorBuilder = BuilderHelper.activeLink(factoryClass)
.named(name)
.andLoadWith(this.loader)
.analyzeWith(this.analyzer);
if (scope != null) {
descriptorBuilder.in(scope);
}
if (ranked != null) {
// factoryContractDescriptor.ofRank(factoryRank);
descriptorBuilder.ofRank(ranked);
}
for (Annotation qualifier : qualifiers) {
factoryDescriptorBuilder.qualifiedBy(qualifier);
descriptorBuilder.qualifiedBy(qualifier);
}
for (Type contract : contracts) {
factoryDescriptorBuilder.to(new ParameterizedTypeImpl(Factory.class, contract));
descriptorBuilder.to(contract);
}
if (proxiable != null) {
descriptorBuilder.proxy(proxiable);
}
if (proxyForSameScope != null) {
descriptorBuilder.proxyForSameScope(proxyForSameScope);
}
configuration.bind(new FactoryDescriptorsImpl(
factoryDescriptorBuilder.build(),
descriptorBuilder.buildProvideMethod()));
}