protected ProducerDefinition createDefinition(String name,
Type type,
Class<?> implClass,
InjectingComponentType componentType,
Member member,
IntrospectionContext context) {
TypeMapping typeMapping = context.getTypeMapping(implClass);
Class<?> baseType = helper.getBaseType(type, typeMapping);
ServiceContract contract = contractProcessor.introspect(baseType, implClass, context, componentType);
if (contract.getOperations().size() != 1) {
String interfaceName = contract.getInterfaceName();
InvalidProducerInterface error = new InvalidProducerInterface("Producer interfaces must have one method: " + interfaceName, member, componentType);
context.addError(error);
}
return new ProducerDefinition(name, contract);
}