org.fabric3.implementation.pojo.spi.proxy.WireProxyService.createSupplier()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.fabric3.implementation.pojo.spi.proxy.WireProxyService.createSupplier()方法的一些代码示例,展示了WireProxyService.createSupplier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WireProxyService.createSupplier()方法的具体详情如下:
包路径:org.fabric3.implementation.pojo.spi.proxy.WireProxyService
类名称:WireProxyService
方法名:createSupplier

WireProxyService.createSupplier介绍

[英]Creates a Supplier that provides proxies for the forward wire.
[中]创建为正向导线提供代理的供应商。

代码示例

代码示例来源:origin: com.carecon.fabric3/fabric3-web

  1. private <B> Supplier<B> createWireFactory(Class<B> interfaze, Wire wire) throws Fabric3Exception {
  2. return proxyService.createSupplier(interfaze, wire, null);
  3. }

代码示例来源:origin: com.carecon.fabric3/fabric3-fabric

  1. public void attach(NonManagedWireSource source, PhysicalWireTarget target, Wire wire) {
  2. Class<?> interfaze = source.getInterface();
  3. Object proxy = proxyService.createSupplier(interfaze, wire, null).get();
  4. source.setProxy(proxy);
  5. }

代码示例来源:origin: org.fabric3/fabric3-fabric

  1. public void attach(NonManagedWireSource source, PhysicalWireTarget target, Wire wire) {
  2. Class<?> interfaze = source.getInterface();
  3. Object proxy = proxyService.createSupplier(interfaze, wire, null).get();
  4. source.setProxy(proxy);
  5. }

代码示例来源:origin: org.fabric3/fabric3-spring

  1. public void attach(SpringWireSource source, PhysicalWireTarget target, Wire wire) {
  2. SpringComponent component = getComponent(source);
  3. String referenceName = source.getReferenceName();
  4. ClassLoader loader = source.getClassLoader();
  5. Class<?> interfaze;
  6. try {
  7. interfaze = loader.loadClass(source.getInterface());
  8. // note callbacks not supported for spring beans
  9. Supplier<?> supplier = proxyService.createSupplier(interfaze, wire, null);
  10. component.attach(referenceName, interfaze, supplier);
  11. for (WireListener listener : listeners) {
  12. listener.onAttach(wire);
  13. }
  14. } catch (ClassNotFoundException e) {
  15. throw new Fabric3Exception(e);
  16. }
  17. }

代码示例来源:origin: com.carecon.fabric3/fabric3-spring

  1. public void attach(SpringWireSource source, PhysicalWireTarget target, Wire wire) {
  2. SpringComponent component = getComponent(source);
  3. String referenceName = source.getReferenceName();
  4. ClassLoader loader = source.getClassLoader();
  5. Class<?> interfaze;
  6. try {
  7. interfaze = loader.loadClass(source.getInterface());
  8. // note callbacks not supported for spring beans
  9. Supplier<?> supplier = proxyService.createSupplier(interfaze, wire, null);
  10. component.attach(referenceName, interfaze, supplier);
  11. for (WireListener listener : listeners) {
  12. listener.onAttach(wire);
  13. }
  14. } catch (ClassNotFoundException e) {
  15. throw new Fabric3Exception(e);
  16. }
  17. }

代码示例来源:origin: com.carecon.fabric3/fabric3-java

  1. private void processReference(Wire wire, JavaWireSource source, PhysicalWireTarget target, JavaComponent component, Injectable injectable, Class<?> type) {
  2. String callbackUri = null;
  3. URI uri = target.getCallbackUri();
  4. if (uri != null) {
  5. callbackUri = uri.toString();
  6. }
  7. Supplier<?> supplier = proxyService.createSupplier(type, wire, callbackUri);
  8. if (source.isKeyed() || source.isOrdered()) {
  9. Object key = getKey(source, target);
  10. int order = source.getOrder();
  11. InjectionAttributes attributes = new InjectionAttributes(key, order);
  12. component.setSupplier(injectable, supplier, attributes);
  13. } else {
  14. component.setSupplier(injectable, supplier);
  15. }
  16. }

代码示例来源:origin: com.carecon.fabric3/fabric3-system

  1. public void attach(SystemWireSource source, PhysicalWireTarget target, Wire wire) {
  2. if (proxyService == null) {
  3. throw new Fabric3Exception("Attempt to inject a non-optimized wire during runtime bootstrap.");
  4. }
  5. URI sourceName = UriHelper.getDefragmentedName(source.getUri());
  6. SystemComponent component = (SystemComponent) manager.getComponent(sourceName);
  7. Injectable injectable = source.getInjectable();
  8. Class<?> type = source.getInterfaceClass();
  9. if (InjectableType.CALLBACK.equals(injectable.getType())) {
  10. throw new UnsupportedOperationException("Callbacks are not supported on system components");
  11. } else {
  12. String callbackUri = null;
  13. URI uri = target.getCallbackUri();
  14. if (uri != null) {
  15. callbackUri = uri.toString();
  16. }
  17. Supplier<?> factory = proxyService.createSupplier(type, wire, callbackUri);
  18. if (source.isKeyed() || source.isOrdered()) {
  19. Object key = getKey(source, target);
  20. int order = source.getOrder();
  21. InjectionAttributes attributes = new InjectionAttributes(key, order);
  22. component.setSupplier(injectable, factory, attributes);
  23. } else {
  24. component.setSupplier(injectable, factory);
  25. }
  26. }
  27. }

相关文章