@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { // get the container-interceptor instance final Object interceptorInstance = interceptorInstanceRef.getInstance(); try { final Method method = this.method; return method.invoke(interceptorInstance, context.getInvocationContext()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Method method = SessionBeanHomeInterceptorFactory.INIT_METHOD.get(); final Object[] params = SessionBeanHomeInterceptorFactory.INIT_PARAMETERS.get(); //we remove them immediately, so they are not set for the rest of the invocation //TODO: find a better way to handle this SessionBeanHomeInterceptorFactory.INIT_METHOD.remove(); SessionBeanHomeInterceptorFactory.INIT_PARAMETERS.remove(); if (method != null) { final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { context.putPrivateData(InvocationType.class, InvocationType.SFSB_INIT_METHOD); method.invoke(context.getTarget(), params); } catch (InvocationTargetException e) { if (CreateException.class.isAssignableFrom(e.getCause().getClass())) { EjbExceptionTransformingInterceptorFactories.setCreateException((CreateException) e.getCause()); } throw Interceptors.rethrow(e.getCause()); } finally { context.putPrivateData(InvocationType.class, invocationType); } } return context.proceed(); } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause());
/** {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { try { return method.invoke(target, (Object[]) context.getParameters()); } catch (InvocationTargetException e) { throw rethrow(e.getCause()); } } }
protected void invokeEjbPostCreate(final InterceptorContext context, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception { try { ejbPostCreate.invoke(instance.getInstance(), params); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } }
protected void invokeEjbPostCreate(final Map<Object, Object> contextData, final Method ejbPostCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception { try { ejbPostCreate.invoke(instance.getInstance(), params); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = instanceRef.get(); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { // get the container-interceptor instance final Object interceptorInstance = interceptorInstanceRef.getInstance(); try { final Method method = this.method; return method.invoke(interceptorInstance, context.getInvocationContext()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
protected Object invokeEjbCreate(final InterceptorContext context, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception { final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { context.putPrivateData(InvocationType.class, InvocationType.ENTITY_EJB_CREATE); return ejbCreate.invoke(instance.getInstance(), params); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } finally { context.putPrivateData(InvocationType.class, invocationType); } } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { if (method != null) { final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { context.putPrivateData(InvocationType.class, InvocationType.SFSB_INIT_METHOD); method.invoke(context.getTarget(), params); } catch (InvocationTargetException e) { if (CreateException.class.isAssignableFrom(e.getCause().getClass())) { EjbExceptionTransformingInterceptorFactories.setCreateException((CreateException) e.getCause()); } throw Interceptors.rethrow(e.getCause()); } finally { context.putPrivateData(InvocationType.class, invocationType); } } return context.proceed(); } };
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
protected Object invokeEjbCreate(final Map<Object, Object> contextData, final Method ejbCreate, final EntityBeanComponentInstance instance, final Object[] params) throws Exception { //there will always be an invocation //as this is only used from home invocations final InterceptorContext context = CurrentInvocationContext.get(); final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { context.putPrivateData(InvocationType.class, InvocationType.ENTITY_EJB_CREATE); return ejbCreate.invoke(instance.getInstance(), params); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); }finally { context.putPrivateData(InvocationType.class, invocationType); } } }
public Object processInvocation(final InterceptorContext context) throws Exception { final Method method = context.getMethod(); if (method == null) { return null; } try { Object target = context.getTarget(); if (target == null) { throw msg.nullProperty("target", context); } return method.invoke(target, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } }
/** {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { try { Method method = this.method; if (withContext) { if (changeMethod) { final Method oldMethod = context.getMethod(); context.setMethod(method); try { return method.invoke(interceptorInstance, context.getInvocationContext()); } finally { context.setMethod(oldMethod); } } else { return method.invoke(interceptorInstance, context.getInvocationContext()); } } else { method.invoke(interceptorInstance, null); return context.proceed(); } } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } }
throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause());
throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause());