@Override public Object processInvocation(final InterceptorContext context) throws Exception { aroundConstruct.processInvocation(context); context.setParameters(null); return context.proceed(); } };
@Override public void callTimeout(final TimerImpl timer, final Method timeoutMethod) throws Exception { final Interceptor interceptor; synchronized (this) { if (!started) { //this can happen if an invocation has been triggered as the deployment is shutting down throw EjbLogger.EJB3_TIMER_LOGGER.timerInvocationFailedDueToInvokerNotBeingStarted(); } interceptor = timeoutInterceptors.get(timeoutMethod); } if(interceptor == null) { throw EjbLogger.EJB3_TIMER_LOGGER.failToInvokeTimeout(timeoutMethod); } final InterceptorContext context = new InterceptorContext(); context.setContextData(new HashMap<String, Object>()); context.setMethod(timeoutMethod); if(timeoutMethod.getParameterTypes().length == 0) { context.setParameters(new Object[0]); } else { final Object[] params = new Object[1]; params[0] = timer; context.setParameters(params); } context.setTimer(timer); context.putPrivateData(Component.class, ejbComponent.getValue()); context.putPrivateData(MethodIntf.class, MethodIntf.TIMER); context.putPrivateData(InvocationType.class, InvocationType.TIMER); interceptor.processInvocation(context); }
@SuppressWarnings("unchecked") @Override public T aroundConstruct(ConstructionHandle<T> ctx, AnnotatedConstructor<T> constructor, Object[] parameters, Map<String, Object> data) throws Exception { context.putPrivateData(ConstructionHandle.class, ctx); context.setParameters(parameters); context.setContextData(data); context.setConstructor(constructor.getJavaMember()); context.proceed(); // proceed with the WF interceptor chain return (T) context.getTarget(); } });
/** {@inheritDoc} */ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new InterceptorContext(); // special location for original proxy context.putPrivateData(Object.class, proxy); context.putPrivateData(Component.class, componentView.getComponent()); context.putPrivateData(ComponentView.class, componentView); context.putPrivateData(SecurityDomain.class, WildFlySecurityManager.isChecking() ? AccessController.doPrivileged((PrivilegedAction<SecurityDomain>) SecurityDomain::getCurrent) : SecurityDomain.getCurrent()); instance.prepareInterceptorContext(context); context.setParameters(args); context.setMethod(method); // setup the public context data context.setContextData(new HashMap<String, Object>()); context.setBlockingCaller(true); return interceptor.processInvocation(context); } }
private void prepareInterceptorContext(final SkeletonStrategy op, final Object[] params, final InterceptorContext interceptorContext) throws IOException, ClassNotFoundException { if (!home) { if (componentView.getComponent() instanceof StatefulSessionComponent) { final SessionID sessionID = (SessionID) unmarshalIdentifier(); interceptorContext.putPrivateData(SessionID.class, sessionID); } } interceptorContext.setContextData(new HashMap<>()); interceptorContext.setParameters(params); interceptorContext.setMethod(op.getMethod()); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, componentView.getComponent()); interceptorContext.putPrivateData(InvocationType.class, InvocationType.REMOTE); interceptorContext.setTransaction(inboundTxCurrent == null ? null : inboundTxCurrent.getCurrentTransaction()); }
static Object invokeMethod(final ComponentView componentView, final Method method, final InvocationRequest incomingInvocation, final InvocationRequest.Resolved content, final CancellationFlag cancellationFlag, Map<String, Object> contextDataHolder) throws Exception { final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.setParameters(content.getParameters()); interceptorContext.setMethod(method); interceptorContext.putPrivateData(Component.class, componentView.getComponent());
interceptorContext.setParameters(parameters); interceptorContext.setMethod(method); interceptorContext.setTransaction(invocation.getTransaction());
@Override public Object processInvocation(final InterceptorContext context) throws Exception { aroundConstruct.processInvocation(context); context.setParameters(null); return context.proceed(); } };
@Override public Object processInvocation(final InterceptorContext context) throws Exception { aroundConstruct.processInvocation(context); context.setParameters(null); return context.proceed(); } };
InterceptorContext.this.setParameters(params);
/** * Handle a proxy method invocation. * * @param proxy the proxy instance * @param method the invoked method * @param args the method arguments * @return the result of the method call * @throws Throwable the exception to thrown from the method invocation on the proxy instance, if any */ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { InterceptorContext context = new InterceptorContext(); context.setParameters(args); context.setMethod(method); return interceptor.processInvocation(context); }
/** {@inheritDoc} */ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new InterceptorContext(); // special location for original proxy context.putPrivateData(Object.class, proxy); context.putPrivateData(Component.class, component); context.putPrivateData(ComponentView.class, componentView); context.setParameters(args); context.setMethod(method); // setup the public context data context.setContextData(new HashMap()); return interceptor.processInvocation(context); } }
/** {@inheritDoc} */ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new InterceptorContext(); // special location for original proxy context.putPrivateData(Object.class, proxy); context.putPrivateData(Component.class, componentView.getComponent()); context.putPrivateData(ComponentView.class, componentView); context.putPrivateData(SecurityDomain.class, WildFlySecurityManager.isChecking() ? AccessController.doPrivileged((PrivilegedAction<SecurityDomain>) SecurityDomain::getCurrent) : SecurityDomain.getCurrent()); instance.prepareInterceptorContext(context); context.setParameters(args); context.setMethod(method); // setup the public context data context.setContextData(new HashMap<String, Object>()); context.setBlockingCaller(true); return interceptor.processInvocation(context); } }
/** {@inheritDoc} */ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new InterceptorContext(); // special location for original proxy context.putPrivateData(Object.class, proxy); context.putPrivateData(Component.class, componentView.getComponent()); context.putPrivateData(ComponentView.class, componentView); context.putPrivateData(SecurityDomain.class, WildFlySecurityManager.isChecking() ? AccessController.doPrivileged((PrivilegedAction<SecurityDomain>) SecurityDomain::getCurrent) : SecurityDomain.getCurrent()); instance.prepareInterceptorContext(context); context.setParameters(args); context.setMethod(method); // setup the public context data context.setContextData(new HashMap<String, Object>()); context.setBlockingCaller(true); return interceptor.processInvocation(context); } }
@Override public void callTimeout(final TimerImpl timer, final Method timeoutMethod) throws Exception { if(!started) { //this can happen if an invocation has been triggered as the deployment is shutting down throw EjbMessages.MESSAGES.timerInvocationFailedDueToInvokerNotBeingStarted(); } final Interceptor interceptor = timeoutInterceptors.get(timeoutMethod); if(interceptor == null) { throw EjbMessages.MESSAGES.failToInvokeTimeout(timeoutMethod); } final InterceptorContext context = new InterceptorContext(); context.setContextData(new HashMap<String, Object>()); context.setMethod(timeoutMethod); if(timeoutMethod.getParameterTypes().length == 0) { context.setParameters(new Object[0]); } else { final Object[] params = new Object[1]; params[0] = timer; context.setParameters(params); } context.setTimer(timer); if(timer.getPrimaryKey() != null) { context.putPrivateData(EntityBeanComponent.PRIMARY_KEY_CONTEXT_KEY, timer.getPrimaryKey()); } context.putPrivateData(Component.class, ejbComponent.getValue()); context.putPrivateData(MethodIntf.class, MethodIntf.TIMER); context.putPrivateData(InvocationType.class, InvocationType.TIMER); interceptor.processInvocation(context); }
private void prepareInterceptorContext(final SkeletonStrategy op, final Object[] params, final InterceptorContext interceptorContext) throws IOException, ClassNotFoundException { if (!home) { if (componentView.getComponent() instanceof StatefulSessionComponent) { final SessionID sessionID = (SessionID) unmarshalIdentifier(); interceptorContext.putPrivateData(SessionID.class, sessionID); } else if (componentView.getComponent() instanceof EntityBeanComponent) { final Object pk = unmarshalIdentifier(); interceptorContext.putPrivateData(EntityBeanComponent.PRIMARY_KEY_CONTEXT_KEY, pk); } } interceptorContext.setContextData(new HashMap<String, Object>()); interceptorContext.setParameters(params); interceptorContext.setMethod(op.getMethod()); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, componentView.getComponent()); }
prepareForInvocation(context, wsInvocation); context.setMethod(method); context.setParameters(wsInvocation.getArgs()); context.setTarget(reference.getInstance()); context.putPrivateData(Component.class, componentView.getComponent());
context.setParameters(reqParams); final Object resObj = context.proceed();
prepareForInvocation(context, wsInvocation); context.setMethod(method); context.setParameters(wsInvocation.getArgs()); context.putPrivateData(Component.class, component); context.putPrivateData(ComponentView.class, componentView);
prepareForInvocation(context, wsInvocation); context.setMethod(method); context.setParameters(wsInvocation.getArgs()); context.putPrivateData(Component.class, component); context.putPrivateData(ComponentView.class, componentView);