ServiceContract<?> contract = registry.introspect(Foo.class);
contract.setCallbackClass(FooCallback.class);
contract.setCallbackName("callback");
JavaMappedReference mappedReference = new JavaMappedReference("foo", contract, method);
type.getReferences().put("foo", mappedReference);
ReferenceTarget refTarget = new ReferenceTarget();
refTarget.setReferenceName("foo");
refTarget.getTargets().add(new URI("foo"));
JavaImplementation impl = new JavaImplementation();
impl.setComponentType(type);
impl.setImplementationClass(FooClient.class);
ComponentDefinition<JavaImplementation> def = new ComponentDefinition<JavaImplementation>(name, impl);
def.getReferenceTargets().put("foo", refTarget);