private void processReference(Wire wire, JavaWireSource source, PhysicalWireTarget target, JavaComponent component, Injectable injectable, Class<?> type) { String callbackUri = null; URI uri = target.getCallbackUri(); if (uri != null) { callbackUri = uri.toString(); } Supplier<?> supplier = proxyService.createSupplier(type, wire, callbackUri); if (source.isKeyed() || source.isOrdered()) { Object key = getKey(source, target); int order = source.getOrder(); InjectionAttributes attributes = new InjectionAttributes(key, order); component.setSupplier(injectable, supplier, attributes); } else { component.setSupplier(injectable, supplier); } }
public void attach(SystemWireSource source, PhysicalWireTarget target, Wire wire) { if (proxyService == null) { throw new Fabric3Exception("Attempt to inject a non-optimized wire during runtime bootstrap."); } URI sourceName = UriHelper.getDefragmentedName(source.getUri()); SystemComponent component = (SystemComponent) manager.getComponent(sourceName); Injectable injectable = source.getInjectable(); Class<?> type = source.getInterfaceClass(); if (InjectableType.CALLBACK.equals(injectable.getType())) { throw new UnsupportedOperationException("Callbacks are not supported on system components"); } else { String callbackUri = null; URI uri = target.getCallbackUri(); if (uri != null) { callbackUri = uri.toString(); } Supplier<?> factory = proxyService.createSupplier(type, wire, callbackUri); if (source.isKeyed() || source.isOrdered()) { Object key = getKey(source, target); int order = source.getOrder(); InjectionAttributes attributes = new InjectionAttributes(key, order); component.setSupplier(injectable, factory, attributes); } else { component.setSupplier(injectable, factory); } } }