protected InterceptorContext prepareInterceptorContext() { final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(Component.class, component); interceptorContext.putPrivateData(ComponentInstance.class, this); interceptorContext.setContextData(new HashMap<String, Object>()); return interceptorContext; }
@Override public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component); clientPreDestroyInterceptor.processInvocation(interceptorContext); } catch (Exception e) { ROOT_LOGGER.preDestroyInterceptorFailure(e, component.getComponentClass()); } }
final InterceptorContext interceptorContext = new InterceptorContext(); prepareInterceptorContext(op, arguments, interceptorContext); return componentView.invoke(interceptorContext);
/** {@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); } }
InterceptorContext context = new InterceptorContext(); context.putPrivateData(ComponentView.class, componentView); context.putPrivateData(Component.class, component); public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component);
@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); }
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);
final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(Component.class, this); interceptorContext.putPrivateData(ComponentInstance.class, basicComponentInstance);
private Object execute(final Interceptor interceptor, final Method method, final Object... parameters) { if (interceptor == null) return null; final InterceptorContext interceptorContext = new InterceptorContext(); //we need the method so this does not count as a lifecycle invocation interceptorContext.setMethod(method); interceptorContext.putPrivateData(Component.class, getComponent()); interceptorContext.putPrivateData(ComponentInstance.class, this); interceptorContext.putPrivateData(InvokeMethodOnTargetInterceptor.PARAMETERS_KEY, parameters); interceptorContext.setContextData(new HashMap<String, Object>()); interceptorContext.setTarget(getInstance()); final AbstractTransaction transaction = ContextTransactionManager.getInstance().getTransaction(); interceptorContext.setTransactionSupplier(() -> transaction); try { return interceptor.processInvocation(interceptorContext); } catch (Error e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EJBException(e); } }
identity = this.authenticate(principal, password); final InterceptorContext interceptorContext = new InterceptorContext(); this.prepareInterceptorContext(op, params, interceptorContext); try { final InterceptorContext interceptorContext = new InterceptorContext(); if (legacyContext != null) { interceptorContext.putPrivateData(SecurityContext.class, legacyContext);
final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.setParameters(parameters); interceptorContext.setMethod(method);
/** * Clone this interceptor context instance. The cloned context will resume execution at the same point that * this context would have at the moment it was cloned. * * @return the copied context */ public InterceptorContext clone() { return new InterceptorContext(this, true); }
protected InterceptorContext prepareInterceptorContext() { final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(Component.class, component); interceptorContext.putPrivateData(ComponentInstance.class, this); interceptorContext.setContextData(new HashMap<String, Object>()); return interceptorContext; }
protected InterceptorContext prepareInterceptorContext() { final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(Component.class, component); interceptorContext.putPrivateData(ComponentInstance.class, this); interceptorContext.setContextData(new HashMap<String, Object>()); return interceptorContext; }
protected InterceptorContext prepareInterceptorContext() { final InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(Component.class, component); interceptorContext.putPrivateData(ComponentInstance.class, this); interceptorContext.setContextData(new HashMap<String, Object>()); return interceptorContext; }
/** * 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); } }
@Override public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component); clientPreDestroyInterceptor.processInvocation(interceptorContext); } catch (Exception e) { ROOT_LOGGER.preDestroyInterceptorFailure(e, component.getComponentClass()); } }
@Override public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component); clientPreDestroyInterceptor.processInvocation(interceptorContext); } catch (Exception e) { ROOT_LOGGER.preDestroyInterceptorFailure(e, component.getComponentClass()); } }
@Override public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component); clientPreDestroyInterceptor.processInvocation(interceptorContext); } catch (Exception e) { ROOT_LOGGER.preDestroyInterceptorFailure(e, component.getComponentClass()); } }