本文整理了Java中org.fabric3.implementation.pojo.spi.proxy.WireProxyService
类的一些代码示例,展示了WireProxyService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WireProxyService
类的具体详情如下:
包路径:org.fabric3.implementation.pojo.spi.proxy.WireProxyService
类名称:WireProxyService
[英]Delegates to a WireProxyServiceExtension to create wire proxies.
[中]委托WireProxyServiceExtension创建wire代理。
代码示例来源:origin: com.carecon.fabric3/fabric3-web
private <B> Supplier<B> createWireFactory(Class<B> interfaze, Wire wire) throws Fabric3Exception {
return proxyService.createSupplier(interfaze, wire, null);
}
代码示例来源:origin: org.codehaus.fabric3/fabric3-web
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);
}
}
代码示例来源:origin: org.codehaus.fabric3/fabric3-web
@SuppressWarnings({"unchecked"})
public <B, R extends ServiceReference<B>> R cast(B target) {
return (R) proxyService.cast(target);
}
代码示例来源:origin: com.carecon.fabric3/fabric3-java
private void processCallback(Wire wire, PhysicalWireTarget targetDefinition, JavaComponent source, Injectable injectable, Class<?> type) {
URI callbackUri = targetDefinition.getUri();
ScopeContainer container = source.getScopeContainer();
Supplier<?> supplier = source.getSupplier(injectable);
boolean multiThreaded = Scope.COMPOSITE.equals(container.getScope());
if (supplier == null) {
supplier = proxyService.createCallbackSupplier(type, multiThreaded, callbackUri, wire);
} else {
supplier = proxyService.updateCallbackSupplier(supplier, type, multiThreaded, callbackUri, wire);
}
source.setSupplier(injectable, supplier);
}
代码示例来源:origin: com.carecon.fabric3/fabric3-fabric
public void attach(NonManagedWireSource source, PhysicalWireTarget target, Wire wire) {
Class<?> interfaze = source.getInterface();
Object proxy = proxyService.createSupplier(interfaze, wire, null).get();
source.setProxy(proxy);
}
代码示例来源:origin: org.fabric3/fabric3-node-impl
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);
}
}
代码示例来源:origin: org.fabric3/fabric3-fabric
public void attach(NonManagedWireSource source, PhysicalWireTarget target, Wire wire) {
Class<?> interfaze = source.getInterface();
Object proxy = proxyService.createSupplier(interfaze, wire, null).get();
source.setProxy(proxy);
}
代码示例来源:origin: org.codehaus.fabric3/fabric3-spring
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);
}
}
代码示例来源:origin: org.fabric3/fabric3-spring
public void attach(SpringWireSource source, PhysicalWireTarget target, Wire wire) {
SpringComponent component = getComponent(source);
String referenceName = source.getReferenceName();
ClassLoader loader = source.getClassLoader();
Class<?> interfaze;
try {
interfaze = loader.loadClass(source.getInterface());
// note callbacks not supported for spring beans
Supplier<?> supplier = proxyService.createSupplier(interfaze, wire, null);
component.attach(referenceName, interfaze, supplier);
for (WireListener listener : listeners) {
listener.onAttach(wire);
}
} catch (ClassNotFoundException e) {
throw new Fabric3Exception(e);
}
}
代码示例来源:origin: com.carecon.fabric3/fabric3-spring
public void attach(SpringWireSource source, PhysicalWireTarget target, Wire wire) {
SpringComponent component = getComponent(source);
String referenceName = source.getReferenceName();
ClassLoader loader = source.getClassLoader();
Class<?> interfaze;
try {
interfaze = loader.loadClass(source.getInterface());
// note callbacks not supported for spring beans
Supplier<?> supplier = proxyService.createSupplier(interfaze, wire, null);
component.attach(referenceName, interfaze, supplier);
for (WireListener listener : listeners) {
listener.onAttach(wire);
}
} catch (ClassNotFoundException e) {
throw new Fabric3Exception(e);
}
}
代码示例来源:origin: com.carecon.fabric3/fabric3-java
private void processReference(Wire wire, JavaWireSource source, PhysicalWireTarget target, JavaComponent component, Injectable injectable, Class<?> type) {
String callbackUri = null;
URI uri = target.getCallbackUri();
if (uri != null) {
callbackUri = uri.toString();
}
Supplier<?> supplier = proxyService.createSupplier(type, wire, callbackUri);
if (source.isKeyed() || source.isOrdered()) {
Object key = getKey(source, target);
int order = source.getOrder();
InjectionAttributes attributes = new InjectionAttributes(key, order);
component.setSupplier(injectable, supplier, attributes);
} else {
component.setSupplier(injectable, supplier);
}
}
代码示例来源:origin: com.carecon.fabric3/fabric3-system
public void attach(SystemWireSource source, PhysicalWireTarget target, Wire wire) {
if (proxyService == null) {
throw new Fabric3Exception("Attempt to inject a non-optimized wire during runtime bootstrap.");
}
URI sourceName = UriHelper.getDefragmentedName(source.getUri());
SystemComponent component = (SystemComponent) manager.getComponent(sourceName);
Injectable injectable = source.getInjectable();
Class<?> type = source.getInterfaceClass();
if (InjectableType.CALLBACK.equals(injectable.getType())) {
throw new UnsupportedOperationException("Callbacks are not supported on system components");
} else {
String callbackUri = null;
URI uri = target.getCallbackUri();
if (uri != null) {
callbackUri = uri.toString();
}
Supplier<?> factory = proxyService.createSupplier(type, wire, callbackUri);
if (source.isKeyed() || source.isOrdered()) {
Object key = getKey(source, target);
int order = source.getOrder();
InjectionAttributes attributes = new InjectionAttributes(key, order);
component.setSupplier(injectable, factory, attributes);
} else {
component.setSupplier(injectable, factory);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!