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; }
@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); } }
@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); }
context.putPrivateData(Component.class, component); context.putPrivateData(ComponentClientInstance.class, instance); context.setContextData(new HashMap<String, Object>()); for(Map.Entry<Object, Object> entry : contextData.entrySet()) { context.putPrivateData(entry.getKey(), entry.getValue());
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()); }
interceptorContext.setContextData(invocationContextData); if (content.getAttachments() != null) {
interceptorContext.putPrivateData(ComponentInstance.class, basicComponentInstance); interceptorContext.putPrivateData(InvocationType.class, InvocationType.POST_CONSTRUCT); interceptorContext.setContextData(new HashMap<String, Object>());
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); } }
if (invocationContextData == null && privateAttachments.isEmpty()) { interceptorContext.setContextData(new HashMap<String, Object>()); } else { final Map<String, Object> data = new HashMap<String, Object>(); interceptorContext.setContextData(data);
@Override protected void prepareForInvocation(final InterceptorContext context, final Invocation wsInvocation) { context.setContextData(getWebServiceContext(wsInvocation).getMessageContext()); }
@Override protected void prepareForInvocation(final InterceptorContext context, final Invocation wsInvocation) { context.setContextData(getWebServiceContext(wsInvocation).getMessageContext()); }
@Override protected void prepareForInvocation(final InterceptorContext context, final Invocation wsInvocation) { context.setContextData(getWebServiceContext(wsInvocation).getMessageContext()); }
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; }
/** {@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); } }
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()); try { return interceptor.processInvocation(interceptorContext); } catch (Error e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EJBException(e); } }
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()); }