public Supplier<?> createSupplier(SystemSourcedWireTarget target) throws Fabric3Exception { URI targetId = UriHelper.getDefragmentedName(target.getUri()); AtomicComponent targetComponent = (AtomicComponent) manager.getComponent(targetId); if (targetComponent == null) { throw new Fabric3Exception("Resource not found: " + targetId); } return targetComponent.createSupplier(); }
private ReferenceAdapter getInstance() { try { Object instance = component.getInstance(); if (!(instance instanceof ReferenceAdapter)) { String componentName = component.getName(); throw new ServiceRuntimeException( "File binding adaptor must implement " + ReferenceAdapter.class.getName() + ":" + componentName); } return (ReferenceAdapter) instance; } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } }