public void connect(String name, ChannelConnection connection) throws Fabric3Exception { Map<String, InjectionSite> sites = siteMappings.get(name); if (sites == null || sites.isEmpty()) { throw new Fabric3Exception("Injection site not found for: " + name); } Class<?> type = sites.values().iterator().next().getType(); Supplier<?> factory = createChannelFactory(type, connection); attach(name, factory); }
/** * Add the injection site for an injectable value. * * @param site the injection site * @param source the value to be injected */ public void addInjectionSite(InjectionSite site, Injectable source) { site.setParent(this); source.setParent(this); injectionSites.put(site, source); }
public void attachWire(String name, Wire wire) throws Fabric3Exception { Map<String, InjectionSite> sites = siteMappings.get(name); if (sites == null || sites.isEmpty()) { throw new Fabric3Exception("Injection site not found for: " + name); } Class<?> type = sites.values().iterator().next().getType(); Supplier<?> supplier = createWireFactory(type, wire); attach(name, supplier); }
if (supplier == null && (type == InjectableType.REFERENCE || type == InjectableType.CALLBACK)) { supplier = createSupplier(site.getType()); factories.put(attribute, supplier);
if (supplier == null && (type == InjectableType.REFERENCE || type == InjectableType.CALLBACK)) { supplier = createSupplier(site.getType()); factories.put(attribute, supplier);