@Override public int hashCode() { return type.hashCode() * 31 + name.hashCode(); } }
public void attach(JavaWireSource source, PhysicalWireTarget target, Wire wire) { URI sourceName = UriHelper.getDefragmentedName(source.getUri()); JavaComponent component = (JavaComponent) manager.getComponent(sourceName); if (component == null) { throw new Fabric3Exception("Source callback not found: " + sourceName); } Injectable injectable = source.getInjectable(); Class<?> type = source.getInterfaceClass(); if (InjectableType.CALLBACK.equals(injectable.getType())) { processCallback(wire, target, component, injectable, type); } else { processReference(wire, source, target, component, injectable, type); } }
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); } } }