ClassFinder finder = new ClassFinder(interceptor.getClass());
providerData.getAroundInvoke().addAll(finder.findAnnotatedMethods(AroundInvoke.class));
interceptorDatas.add(providerData);
}
InterceptorStack interceptorStack = new InterceptorStack(instance.bean, runMethod, Operation.BUSINESS_WS, interceptorDatas, interceptors);
Object[] params = new Object[runMethod.getParameterTypes().length];
if (messageContext instanceof javax.xml.rpc.handler.MessageContext) {
ThreadContext.getThreadContext().set(javax.xml.rpc.handler.MessageContext.class, (javax.xml.rpc.handler.MessageContext) messageContext);
return interceptorStack.invoke((javax.xml.rpc.handler.MessageContext) messageContext, params);
} else if (messageContext instanceof javax.xml.ws.handler.MessageContext) {
AddressingSupport wsaSupport = NoAddressingSupport.INSTANCE;
for (int i = 2; i < args.length; i++) {
if (args[i] instanceof AddressingSupport) {
wsaSupport = (AddressingSupport)args[i];
}
}
ThreadContext.getThreadContext().set(AddressingSupport.class, wsaSupport);
ThreadContext.getThreadContext().set(javax.xml.ws.handler.MessageContext.class, (javax.xml.ws.handler.MessageContext) messageContext);
return interceptorStack.invoke((javax.xml.ws.handler.MessageContext) messageContext, params);
}
throw new IllegalArgumentException("Uknown MessageContext type: " + messageContext.getClass().getName());
}