Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Interceptor


    @Override
    public Object proceed() throws Exception
    {
        if (interceptors != null && interceptorIndex < interceptors.size())
        {
            Interceptor interceptor = interceptors.get(interceptorIndex++);

            if (interceptor.intercepts(type))
            {
                return interceptor.intercept(type, instances.get(interceptor), this);
            }
            else
            {
                return proceed();
            }
View Full Code Here


                if (types.contains(interceptorClass)) // don't create another bean for it
                {
                    continue;
                }

                Interceptor ejbInterceptor = webBeansContext.getInterceptorsManager().getEjbInterceptorForClass(interceptorClass);
                ejbInterceptors.add(ejbInterceptor);
            }
        }
    }
View Full Code Here

                if (types.contains(interceptorClass)) // don't create another bean for it
                {
                    continue;
                }

                Interceptor ejbInterceptor = webBeansContext.getInterceptorsManager().getEjbInterceptorForClass(interceptorClass);
                ejbInterceptors.add(ejbInterceptor);
            }
        }
    }
View Full Code Here

    @Override
    public Object proceed() throws Exception
    {
        if (index < interceptors.size())
        {
            Interceptor interceptor = interceptors.get(index++);
            if (!interceptor.intercepts(type))
            {
                // continue with next interceptor
                // this e.g. happens for lifecycle interceptors
                return proceed();
            }

            return interceptor.intercept(type, instances.get(interceptor), this);
        }
        else
        {
            return realProceed();
        }
View Full Code Here

                if (types.contains(interceptorClass)) // don't create another bean for it
                {
                    continue;
                }

                Interceptor ejbInterceptor = webBeansContext.getInterceptorsManager().getEjbInterceptorForClass(interceptorClass);
                ejbInterceptors.add(ejbInterceptor);
            }
        }
    }
View Full Code Here

    @Override
    public Object proceed() throws Exception
    {
        if (interceptors != null && interceptorIndex < interceptors.size())
        {
            Interceptor interceptor = interceptors.get(interceptorIndex++);

            if (interceptor.intercepts(type))
            {
                return interceptor.intercept(type, instances.get(interceptor), this);
            }
            else
            {
                return proceed();
            }
View Full Code Here

                if (types.contains(interceptorClass)) // don't create another bean for it
                {
                    continue;
                }

                Interceptor ejbInterceptor = webBeansContext.getInterceptorsManager().getEjbInterceptorForClass(interceptorClass);
                ejbInterceptors.add(ejbInterceptor);
            }
        }
    }
View Full Code Here

    @Override
    public Object proceed() throws Exception
    {
        if (index < interceptors.size())
        {
            Interceptor interceptor = interceptors.get(index++);
            if (!interceptor.intercepts(type))
            {
                // continue with next interceptor
                // this e.g. happens for lifecycle interceptors
                return proceed();
            }

            return interceptor.intercept(type, instances.get(interceptor), this);
        }
        else
        {
            return super.proceed();
        }
View Full Code Here

                if (types.contains(interceptorClass)) // don't create another bean for it
                {
                    continue;
                }

                Interceptor ejbInterceptor = webBeansContext.getInterceptorsManager().getEjbInterceptorForClass(interceptorClass);
                ejbInterceptors.add(ejbInterceptor);
            }
        }
    }
View Full Code Here

        beanClasses.add(RuntimeExceptionBindingTypeBean.class);

        startContainer(beanClasses, beanXmls);

        BeanManager beanManager = getBeanManager();
        Interceptor interceptorBean = beanManager.resolveInterceptors(InterceptionType.AROUND_INVOKE, new AnnotationLiteral<RuntimeExceptions>() {}).iterator().next();
        Bean bean = beanManager.resolve(beanManager.getBeans(RuntimeExceptionBindingTypeBean.class));
        CreationalContext creationalContext = beanManager.createCreationalContext(bean);
       
        // we cannot use the container to create the proxy as it already proxies the internal instance
        RuntimeExceptionBindingTypeBean target = new RuntimeExceptionBindingTypeBean();

        RuntimeExceptionsInterceptor interceptor = (RuntimeExceptionsInterceptor) interceptorBean.create(creationalContext);

        Method[] interceptedMethods = {RuntimeExceptionBindingTypeBean.class.getMethod("business")};
        Map<Method, List<Interceptor<?>>> interceptors = new HashMap<Method, List<Interceptor<?>>>();
        interceptors.put(interceptedMethods[0], Arrays.<Interceptor<?>> asList(interceptorBean));
        Map instances = new HashMap();
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.Interceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.