/** * 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 event the event * @param instance the target component instance */ private void invoke(Object event, Object instance) { try { if (targetTCCLClassLoader == null) { invoker.invoke(instance, event); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); invoker.invoke(instance, event); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { throw new InvocationRuntimeException(e.getTargetException()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } }
/** * 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 event the event * @param instance the target component instance */ private void invoke(Object event, Object instance) { try { if (targetTCCLClassLoader == null) { invoker.invoke(instance, event); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); invoker.invoke(instance, event); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { throw new InvocationRuntimeException(e); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } }
/** * 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 event the event * @param instance the target component instance */ private void invoke(Object event, Object instance) { try { if (targetTCCLClassLoader == null) { invoker.invoke(instance, event); } else { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(targetTCCLClassLoader); invoker.invoke(instance, event); } finally { Thread.currentThread().setContextClassLoader(old); } } } catch (InvocationTargetException e) { throw new InvocationRuntimeException(e.getTargetException()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } }