@Override
protected Object performInvocation(Exchange exchange, final Object serviceObject, Method m, Object[] paramArray)
throws Exception
{
Endpoint ep = exchange.get(Endpoint.class);
final InvocationHandler invHandler = ep.getInvocationHandler();
final Invocation inv = createInvocation(invHandler, serviceObject, ep, m, paramArray);
if (factory != null) {
inv.getInvocationContext().setProperty("forceTargetBean", true);
}
Bus threadBus = BusFactory.getThreadDefaultBus(false);
BusFactory.setThreadDefaultBus(disableDepUserDefThreadBus ? null : ep.getAttachment(Bus.class));
setNamespaceContextSelector(exchange);
ClassLoader cl = SecurityActions.getContextClassLoader();
SecurityActions.setContextClassLoader(serviceObject.getClass().getClassLoader());
try {
invHandler.invoke(ep, inv);
return inv.getReturnValue();
} finally {
SecurityActions.setContextClassLoader(cl);
BusFactory.setThreadDefaultBus(threadBus);
clearNamespaceContextSelector(exchange);
}
}