Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.Interceptor$JAXB


    @Keys({@Key(value = "aroundInvoke.invalidArguments", count = 2), @Key(value = "aroundInvoke.badReturnType", count = 2)})
    public EjbJar testInvalidAroundTimeoutParameter() throws Exception {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean("TestInvalidAroundTimeoutParameterBean", TestInvalidAroundTimeoutParameterBean.class));
        ejbJar.addInterceptor(new Interceptor(TestInvalidAroundTimeoutParameterInterceptor.class));
        return ejbJar;
    }
View Full Code Here


    @Keys({@Key(value = "aroundInvoke.badReturnType", count = 2), @Key(value = "aroundInvoke.mustThrowException", count = 2)})
    public EjbJar testInvalidAroundTimeoutReturnValue() throws Exception {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean("TestInvalidAroundTimeoutReturnValueBean", TestInvalidAroundTimeoutReturnValueBean.class));
        ejbJar.addInterceptor(new Interceptor(TestInvalidAroundTimeoutReturnValueInterceptor.class));
        return ejbJar;
    }
View Full Code Here

                    }

                    for (String interceptor : list) {
                        if (ejbJar.getInterceptor(interceptor) == null) {
                            logger.debug("Adding '<ejb-jar><interceptors><interceptor>' entry for undeclared interceptor " + interceptor);
                            ejbJar.addInterceptor(new Interceptor(interceptor));
                        }
                    }
                }

                /*
                 * @Interceptors
                 */
                for (Class<?> interceptorsAnnotatedClass : inheritedClassFinder.findAnnotatedClasses(Interceptors.class)) {
                    Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);
                    EjbJar ejbJar = ejbModule.getEjbJar();
                    for (Class interceptor : interceptors.value()) {
                        if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                            ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                        }
                    }

                    InterceptorBinding binding = new InterceptorBinding(bean);
                    assemblyDescriptor.getInterceptorBinding().add(0, binding);

                    for (Class interceptor : interceptors.value()) {
                        binding.getInterceptorClass().add(interceptor.getName());
                    }
                }

                for (Method method : inheritedClassFinder.findAnnotatedMethods(Interceptors.class)) {
                    Interceptors interceptors = method.getAnnotation(Interceptors.class);
                    if (interceptors != null) {
                        EjbJar ejbJar = ejbModule.getEjbJar();
                        for (Class interceptor : interceptors.value()) {
                            if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                                ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                            }
                        }

                        InterceptorBinding binding = new InterceptorBinding(bean);
                        assemblyDescriptor.getInterceptorBinding().add(0, binding);
View Full Code Here

                    }

                    for (final String interceptor : list) {
                        if (ejbJar.getInterceptor(interceptor) == null) {
                            logger.debug("Adding '<ejb-jar><interceptors><interceptor>' entry for undeclared interceptor " + interceptor);
                            ejbJar.addInterceptor(new Interceptor(interceptor));
                        }
                    }
                }

                /*
                 * @Interceptors
                 */
                final List<Annotated<Class<?>>> annotatedClasses = sortClasses(annotationFinder.findMetaAnnotatedClasses(Interceptors.class));
                for (final Annotated<Class<?>> interceptorsAnnotatedClass : annotatedClasses) {
                    final Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);
                    final EjbJar ejbJar = ejbModule.getEjbJar();
                    for (final Class interceptor : interceptors.value()) {
                        if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                            ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                        }
                    }

                    final InterceptorBinding binding = new InterceptorBinding(bean);
                    assemblyDescriptor.getInterceptorBinding().add(0, binding);

                    for (final Class interceptor : interceptors.value()) {
                        binding.getInterceptorClass().add(interceptor.getName());
                    }
                }

                final List<Annotated<Method>> annotatedMethods = sortMethods(annotationFinder.findMetaAnnotatedMethods(Interceptors.class));
                for (final Annotated<Method> method : annotatedMethods) {
                    final Interceptors interceptors = method.getAnnotation(Interceptors.class);
                    if (interceptors != null) {
                        final EjbJar ejbJar = ejbModule.getEjbJar();
                        for (final Class interceptor : interceptors.value()) {
                            if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                                ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
                            }
                        }

                        final InterceptorBinding binding = new InterceptorBinding(bean);
                        assemblyDescriptor.getInterceptorBinding().add(0, binding);
View Full Code Here

        final EjbJar ejbJar = new EjbJar();
        final AssemblyDescriptor assemblyDescriptor = ejbJar.getAssemblyDescriptor();

        //Configure AroundTimeout by deployment plan
        final Interceptor interceptorA = new Interceptor(SimpleInterceptorA.class);
        interceptorA.getAroundTimeout().add(new org.apache.openejb.jee.AroundTimeout(SimpleInterceptorA.class.getName(), "interceptorTimeoutAround"));
        ejbJar.addInterceptor(interceptorA);

        //Configure AroundTimeout by annotation
        final Interceptor interceptorB = new Interceptor(SimpleInterceptorB.class);
        ejbJar.addInterceptor(interceptorB);

        //Override AroundTimeout annotation by deployment plan
        final Interceptor interceptorC = new Interceptor(SimpleInterceptorC.class);
        interceptorC.getAroundTimeout().add(new org.apache.openejb.jee.AroundTimeout(SimpleInterceptorC.class.getName(), "interceptorTimeoutAround"));
        ejbJar.addInterceptor(interceptorC);

        //Configure aroundTimeout by deployment plan
        final StatelessBean subBeanA = new StatelessBean(SubBeanA.class);
        subBeanA.addAroundTimeout("beanTimeoutAround");
View Full Code Here

        final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(ThirdSLSBean.class));

        final AssemblyDescriptor assembly = ejbJar.getAssemblyDescriptor();

        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorOne.class)));
        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorTwo.class)));

        return ejbJar;
    }
View Full Code Here

        final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(SecondStatelessInterceptedBean.class));

        final AssemblyDescriptor assembly = ejbJar.getAssemblyDescriptor();

        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorOne.class)));
        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorTwo.class)));
        assembly.addInterceptorBinding(new InterceptorBinding(bean)).setExcludeDefaultInterceptors(true);

        return ejbJar;
    }
View Full Code Here

        final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(FullyInterceptedBean.class));

        final AssemblyDescriptor assembly = ejbJar.getAssemblyDescriptor();

        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorOne.class)));
        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorTwo.class)));

        final InterceptorBinding b = assembly.addInterceptorBinding(new InterceptorBinding(bean));
        b.setExcludeDefaultInterceptors(true);
        b.setMethod(new NamedMethod("methodWithDefaultInterceptorsExcluded"));

View Full Code Here

        final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(MethodLevelInterceptorOnlySLSBean.class));

        final AssemblyDescriptor assembly = ejbJar.getAssemblyDescriptor();

        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorOne.class)));
        assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorTwo.class)));
        assembly.addInterceptorBinding(new InterceptorBinding(bean)).setExcludeDefaultInterceptors(true);
        return ejbJar;
    }
View Full Code Here

        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        final EjbJar ejbJar = new EjbJar();
        final AssemblyDescriptor assemblyDescriptor = ejbJar.getAssemblyDescriptor();

        final Interceptor interceptor = new Interceptor(SimpleInterceptor.class);
        ejbJar.addInterceptor(interceptor);

        //Test SessionSynchronization interface
        final StatefulBean subBeanA = new StatefulBean(SubBeanA.class);
        ejbJar.addEnterpriseBean(subBeanA);
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.Interceptor$JAXB

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.