factory = createObjectFactory(baseType, wireList.get(i));
}
factories.add(factory);
}
instanceFactoryProvider.setObjectFactories(element, factories);
JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
for(JavaElementImpl p: constructor.getParameters()){
if(element.getName().equals(p.getName())) {
instanceFactoryProvider.setObjectFactories(p, factories);
}
}
} else {
if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
throw new IllegalStateException("Required reference is missing: " + ref.getName());
}
if (wireList != null && !wireList.isEmpty()) {
ObjectFactory<?> factory = null;
if (CallableReference.class.isAssignableFrom(element.getType())) {
Class<?> businessInterface =
JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
.getGenericType());
factory =
new CallableReferenceObjectFactory(businessInterface, component,
(RuntimeComponentReference)componentReference, null);
} else {
factory = createObjectFactory(element.getType(), wireList.get(0));
}
instanceFactoryProvider.setObjectFactory(element, factory);
JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
for(JavaElementImpl p: constructor.getParameters()){
if(element.getName().equals(p.getName())) {
instanceFactoryProvider.setObjectFactory(p, factory);
}
}
}