protected <B> ObjectFactory<B> createWireFactory(Class<B> interfaze, Wire wire) throws ObjectCreationException { try { return proxyService.createObjectFactory(interfaze, wire, null); } catch (ProxyCreationException e) { throw new ObjectCreationException(e); } }
public void attach(NonManagedPhysicalWireSourceDefinition source, PhysicalWireTargetDefinition target, Wire wire) throws ContainerException { try { ClassLoader loader = registry.getClassLoader(source.getClassLoaderId()); Class<?> interfaze = loader.loadClass(source.getInterface()); Object proxy = proxyService.createObjectFactory(interfaze, wire, null).getInstance(); source.setProxy(proxy); } catch (ClassNotFoundException e) { throw new ContainerException(e); } }
public void attach(SpringSourceDefinition source, PhysicalTargetDefinition target, Wire wire) throws WiringException { SpringComponent component = getComponent(source); String referenceName = source.getReferenceName(); ClassLoader loader = classLoaderRegistry.getClassLoader(source.getClassLoaderId()); Class<?> interfaze; try { interfaze = loader.loadClass(source.getInterface()); // note callbacks not supported for spring beans ObjectFactory<?> factory = proxyService.createObjectFactory(interfaze, wire, null); component.attach(referenceName, interfaze, factory); for (WireListener listener : listeners) { listener.onAttach(wire); } } catch (ClassNotFoundException e) { throw new WiringException(e); } catch (ProxyCreationException e) { throw new WiringException(e); } }