public void attach(PhysicalWireSourceDefinition source, MetroWsdlWireTargetDefinition target, Wire wire) throws ContainerException {
ReferenceEndpointDefinition endpointDefinition = target.getEndpointDefinition();
List<QName> requestedIntents = target.getIntents();
WebServiceFeature[] features = resolver.getFeatures(requestedIntents);
String wsdl = target.getWsdl();
URL wsdlLocation;
try {
URI servicePath = target.getEndpointDefinition().getUrl().toURI();
wsdlLocation = cache.cache(servicePath, new ByteArrayInputStream(wsdl.getBytes()));
} catch (CacheException | URISyntaxException e) {
throw new ContainerException(e);
}
SecurityConfiguration securityConfiguration = target.getSecurityConfiguration();
ConnectionConfiguration connectionConfiguration = target.getConnectionConfiguration();
List<Handler> handlers = createHandlers(target);
MetroDispatchObjectFactory proxyFactory = new MetroDispatchObjectFactory(endpointDefinition,
wsdlLocation,
null,
securityConfiguration,
connectionConfiguration,
handlers,
features,
executorService,
securityEnvironment);
for (InvocationChain chain : wire.getInvocationChains()) {
boolean oneWay = chain.getPhysicalOperation().isOneWay();
MetroDispatchTargetInterceptor targetInterceptor = new MetroDispatchTargetInterceptor(proxyFactory, oneWay);
chain.addInterceptor(targetInterceptor);
}
}