You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Eric Covener <co...@apache.org> on 2010/07/25 19:25:10 UTC

Re: svn commit: r979071 - in /openwebbeans/trunk: webbeans-ejb/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interceptor/ webbeans-impl/ webbeans-impl/src/main/java/org/apache/webbeans/intercept/ webbeans-impl/src/main/java/org/apache/we

Paul, can you submit a followup patch to address a few issues inline below?


> +    @AroundTimeout
> +    public Object callAroundTimeouts(InvocationContext context) throws Exception
> +    {
> +        Object retVal = null;
> +        InjectionTargetBean<?> injectionTarget = (InjectionTargetBean<?>) threadLocal.get();
> +
> +        logger.debug("OpenWebBeansEjbInterceptor: @AroundTimeout called. Trying to run Interceptors.");
> +
> +        if(injectionTarget != null)
> +        {
> +            if (WebBeansUtil.isContainsInterceptorMethod(injectionTarget.getInterceptorStack(), InterceptorType.AROUND_TIMEOUT))
> +            {
> +                InvocationContextImpl impl = new InvocationContextImpl(null, context.getTarget(), null, null,
> +                        InterceptorUtil.getInterceptorMethods(injectionTarget.getInterceptorStack(), InterceptorType.AROUND_TIMEOUT), InterceptorType.AROUND_TIMEOUT);
> +                impl.setCreationalContext(threadLocalCreationalContext.get());
> +                try
> +                {
> +                    //run OWB interceptors
> +                    impl.proceed();

I think something needs to be done with the return value of the 299
stack.  This does not apply to the passivation related chunks.

> +
> +                    //run EJB interceptors
> +                    retVal = context.proceed();

Please take a look at the recent restructuring of the lifecycle
interceptos == ejbcontect.proceed needs to occur outside of the
if(...intereceptor stack not empty). This does apply to the
passivation related chunks as well.

I think it is safe to a) remove the TODOS around
runPrePostForNonContextual and also to rename that routine.  If it's
used for AroundTimeout, even "lifecycle" is probably bad.  Maybe
runInterceptorsForNonContextualEJB or something.


-- 
Eric Covener
covener@gmail.com