ComponentReference ref = component.getReference(name);
if (ref.getInterfaceContract() == null) {
ExtensionPointRegistry epr = component.getComponentContext().getExtensionPointRegistry();
FactoryExtensionPoint fep = epr.getExtensionPoint(FactoryExtensionPoint.class);
JavaInterfaceFactory jif = fep.getFactory(JavaInterfaceFactory.class);
JavaInterface javaIface = jif.createJavaInterface(typeClass);
InterfaceContract interfaceContract = jif.createJavaInterfaceContract();
interfaceContract.setInterface(javaIface);
ref.setInterfaceContract(interfaceContract);
}
}