Class interfaze = service.getServiceContract().getInterface();
QualifiedName targetName = new QualifiedName(configuredService.getPart().getName() + QualifiedName.NAME_SEPARATOR
+ service.getName());
Map<Method, TargetInvocationConfiguration> iConfigMap = new MethodHashMap<TargetInvocationConfiguration>();
TargetWireFactory wireFactory = wireFactoryFactory.createTargetWireFactory();
Set<Method> javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(interfaze);
for (Method method : javaMethods) {
TargetInvocationConfiguration iConfig = new TargetInvocationConfiguration(method);
iConfigMap.put(method, iConfig);
}
WireTargetConfiguration wireConfiguration = new WireTargetConfiguration(targetName, iConfigMap, interfaze.getClassLoader(), messageFactory);
wireFactory.setBusinessInterface(interfaze);
wireFactory.setConfiguration(wireConfiguration);
if (policyRegistry != null) {
// invoke policy builders
policyRegistry.buildTarget(configuredService, wireConfiguration);
}
// add tail interceptor
for (TargetInvocationConfiguration iConfig : wireFactory.getConfiguration().getInvocationConfigurations().values()) {
iConfig.addInterceptor(new InvokerInterceptor());
}
return wireFactory;
}