org.fabric3.implementation.pojo.spi.proxy.WireProxyService类的使用及代码示例

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

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

WireProxyService介绍

[英]Delegates to a WireProxyServiceExtension to create wire proxies.
[中]委托WireProxyServiceExtension创建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: org.codehaus.fabric3/fabric3-web

  1. protected <B> ObjectFactory<B> createWireFactory(Class<B> interfaze, Wire wire) throws ObjectCreationException {
  2. try {
  3. return proxyService.createObjectFactory(interfaze, wire, null);
  4. } catch (ProxyCreationException e) {
  5. throw new ObjectCreationException(e);
  6. }
  7. }

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

  1. @SuppressWarnings({"unchecked"})
  2. public <B, R extends ServiceReference<B>> R cast(B target) {
  3. return (R) proxyService.cast(target);
  4. }

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

  1. private void processCallback(Wire wire, PhysicalWireTarget targetDefinition, JavaComponent source, Injectable injectable, Class<?> type) {
  2. URI callbackUri = targetDefinition.getUri();
  3. ScopeContainer container = source.getScopeContainer();
  4. Supplier<?> supplier = source.getSupplier(injectable);
  5. boolean multiThreaded = Scope.COMPOSITE.equals(container.getScope());
  6. if (supplier == null) {
  7. supplier = proxyService.createCallbackSupplier(type, multiThreaded, callbackUri, wire);
  8. } else {
  9. supplier = proxyService.updateCallbackSupplier(supplier, type, multiThreaded, callbackUri, wire);
  10. }
  11. source.setSupplier(injectable, supplier);
  12. }

代码示例来源: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-node-impl

  1. public void attach(NonManagedPhysicalWireSourceDefinition source, PhysicalWireTargetDefinition target, Wire wire) throws ContainerException {
  2. try {
  3. ClassLoader loader = registry.getClassLoader(source.getClassLoaderId());
  4. Class<?> interfaze = loader.loadClass(source.getInterface());
  5. Object proxy = proxyService.createObjectFactory(interfaze, wire, null).getInstance();
  6. source.setProxy(proxy);
  7. } catch (ClassNotFoundException e) {
  8. throw new ContainerException(e);
  9. }
  10. }

代码示例来源: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.codehaus.fabric3/fabric3-spring

  1. public void attach(SpringSourceDefinition source, PhysicalTargetDefinition target, Wire wire) throws WiringException {
  2. SpringComponent component = getComponent(source);
  3. String referenceName = source.getReferenceName();
  4. ClassLoader loader = classLoaderRegistry.getClassLoader(source.getClassLoaderId());
  5. Class<?> interfaze;
  6. try {
  7. interfaze = loader.loadClass(source.getInterface());
  8. // note callbacks not supported for spring beans
  9. ObjectFactory<?> factory = proxyService.createObjectFactory(interfaze, wire, null);
  10. component.attach(referenceName, interfaze, factory);
  11. for (WireListener listener : listeners) {
  12. listener.onAttach(wire);
  13. }
  14. } catch (ClassNotFoundException e) {
  15. throw new WiringException(e);
  16. } catch (ProxyCreationException e) {
  17. throw new WiringException(e);
  18. }
  19. }

代码示例来源: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. }

相关文章