public void detach(SystemConnectionSource source, PhysicalConnectionTarget target) throws Fabric3Exception { URI sourceName = UriHelper.getDefragmentedName(source.getUri()); SystemComponent component = (SystemComponent) manager.getComponent(sourceName); Injectable injectable = source.getInjectable(); component.removeSupplier(injectable); }
public void attach( SystemConnectionSource source, PhysicalConnectionTarget target, ChannelConnection connection) { URI sourceUri = source.getUri(); URI sourceName = UriHelper.getDefragmentedName(sourceUri); SystemComponent component = (SystemComponent) manager.getComponent(sourceName); Injectable injectable = source.getInjectable(); Class<?> type = source.getServiceInterface(); Supplier<?> supplier; if (source.isDirectConnection()) { supplier = connection.getDirectConnection().get(); } else { supplier = proxyService.createSupplier(type, connection); } component.setSupplier(injectable, supplier); }