/** * Performs the invocation on the target component instance. If a target classloader is configured for the interceptor, it will be set as the TCCL. * * @param msg the messaging containing the invocation data * @param instance the target component instance * @return the response message */ private Message invoke(Message msg, Object instance) { try { Object body = msg.getBody(); if (targetTCCLClassLoader == null) { msg.setBody(invoker.invoke(instance, body)); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); msg.setBody(invoker.invoke(instance, body)); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { msg.setBodyWithFault(e.getCause()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } return msg; }
/** * Performs the invocation on the target component instance. If a target classloader is configured for the interceptor, it will be set as the TCCL. * * @param msg the messaging containing the invocation data * @param instance the target component instance * @return the response message */ private Message invoke(Message msg, Object instance) { try { Object body = msg.getBody(); if (targetTCCLClassLoader == null) { msg.setBody(invoker.invoke(instance, body)); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); msg.setBody(invoker.invoke(instance, body)); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { msg.setBodyWithFault(e.getCause()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } return msg; }
/** * Performs the invocation on the target component instance. If a target classloader is configured for the interceptor, it will be set as the TCCL. * * @param msg the messaging containing the invocation data * @param instance the target component instance * @return the response message */ private Message invoke(Message msg, Object instance) { try { Object body = msg.getBody(); if (targetTCCLClassLoader == null) { msg.setBody(invoker.invoke(instance, body)); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); msg.setBody(invoker.invoke(instance, body)); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { msg.setBodyWithFault(e.getCause()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } return msg; }