public Message invoke(Message msg) { Object instance; try { instance = component.getInstance(); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } try { return invoke(msg, instance); } finally { try { component.releaseInstance(instance); } catch (Fabric3Exception 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); } }
/** * 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); } }
public Message invoke(Message msg) { Object instance; try { instance = component.getInstance(); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } try { return invoke(msg, instance); } finally { try { component.releaseInstance(instance); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } } }
public Message invoke(Message msg) { Object body = msg.getBody(); Object instance; try { instance = component.getInstance(); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } try { msg.setBody(operation.invoke(instance, (Object[]) body)); } catch (InvocationTargetException e) { msg.setBodyWithFault(e.getCause()); } catch (IllegalAccessException e) { throw new InvocationRuntimeException(e); } finally { try { component.releaseInstance(instance); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } } return msg; } }
throw new InvocationRuntimeException(e); } catch (BeansException e) { throw new InvocationRuntimeException("Error invoking bean: " + beanName, e);
public void handle(Object event, boolean endOfBatch) { WorkContextCache.getAndResetThreadWorkContext(); Object instance; try { instance = component.getInstance(); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } try { invoke(event, instance); } finally { try { component.releaseInstance(instance); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } } }
throw new InvocationRuntimeException(e); } catch (BeansException e) { throw new InvocationRuntimeException("Error invoking bean: " + beanName, e);
throw new InvocationRuntimeException(e); } catch (BeansException e) { throw new InvocationRuntimeException("Error invoking bean: " + beanName, e);
public void handle(Object event, boolean endOfBatch) { WorkContextCache.getAndResetThreadWorkContext(); Object instance; try { instance = component.getInstance(); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } try { invoke(event, instance); } finally { try { component.releaseInstance(instance); } catch (Fabric3Exception e) { throw new InvocationRuntimeException(e); } } }
throw new InvocationRuntimeException(e); } catch (BeansException e) { throw new InvocationRuntimeException("Error invoking bean: " + beanName, 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 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; }