Examples of NamedMethod


Examples of org.apache.openejb.jee.NamedMethod

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

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

        return ejbJar;
    }
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

        final StatefulBean bean1 = new StatefulBean(MyLocalBeanImpl.class);
        final Timeout timeout1 = new Timeout();
        timeout1.setTimeout(10);
        timeout1.setUnit(TimeUnit.SECONDS);
        final ConcurrentMethod method1 = new ConcurrentMethod();
        method1.setMethod(new NamedMethod("*"));
        method1.setAccessTimeout(timeout1);
        bean1.getConcurrentMethod().add(method1);

        ejbJar.addEnterpriseBean(bean1);

View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

        ad.addInterceptorBinding(new InterceptorBinding("*", interceptor));

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", List.class)));
        }

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", int.class)));
        }

        {
            interceptor = ejbJar.addInterceptor(new Interceptor(EchoMethodInterceptorViaDD.class));
            InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean, interceptor));
            binding.setMethod(new NamedMethod(TargetBean.class.getMethod("echo", boolean.class)));
        }

        EnterpriseBean bean3 = ejbJar.addEnterpriseBean(new StatelessBean(Target3Bean.class));
        InterceptorBinding binding = ad.addInterceptorBinding(new InterceptorBinding(bean3));
        binding.setExcludeDefaultInterceptors(true);
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

    Interceptor interceptor = new Interceptor(SessionBeanConverterTest.class);
    ejbJar.addInterceptor(interceptor);
    List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
   
    InterceptorBinding binding = new InterceptorBinding(bean, interceptor);
    NamedMethod method = new NamedMethod();
    method.setMethodName("test"); //$NON-NLS-1$
    method.setMethodParams(new MethodParams());
    binding.setMethod(method);
    interceptorBindings.add(binding);
   
    // execute
    converter.processInterceptors(ejbJar);
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

    ejbJar.addInterceptor(interceptor);
    List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
   
    InterceptorBinding binding = new InterceptorBinding(bean, interceptor);
    binding.setExcludeDefaultInterceptors(true);
    NamedMethod method = new NamedMethod();
    method.setMethodName("test"); //$NON-NLS-1$
    method.setMethodParams(new MethodParams());
    binding.setMethod(method);
    interceptorBindings.add(binding);
   
    // execute
    converter.processInterceptors(ejbJar);
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

    ejbJar.addInterceptor(interceptor);
    List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
   
    InterceptorBinding binding = new InterceptorBinding(bean, interceptor);
    binding.setExcludeClassInterceptors(true);
    NamedMethod method = new NamedMethod();
    method.setMethodName("test"); //$NON-NLS-1$
    method.setMethodParams(new MethodParams());
    binding.setMethod(method);
    interceptorBindings.add(binding);
   
    // execute
    converter.processInterceptors(ejbJar);
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

            annotationHelper.addClassAnnotation(bean.getEjbClass(), ExcludeClassInterceptors.class, properties);
          }

          annotationHelper.addClassAnnotation(bean.getEjbClass(), Interceptors.class, properties);
        } else {
          NamedMethod method = interceptorBinding.getMethod();
          String[] signature = method.getMethodParams().getMethodParam().toArray(new String[0]);

          if (interceptorBinding.getExcludeDefaultInterceptors()) {
            annotationHelper.addMethodAnnotation(bean.getEjbClass(), method.getMethodName(), signature, ExcludeDefaultInterceptors.class, properties);
          }

          if (interceptorBinding.getExcludeClassInterceptors()) {
            annotationHelper.addMethodAnnotation(bean.getEjbClass(), method.getMethodName(), signature, ExcludeClassInterceptors.class, properties);
          }

          annotationHelper.addMethodAnnotation(bean.getEjbClass(), method.getMethodName(), signature, Interceptors.class, properties);
        }
      } catch (Exception e) {
        String warning = String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.12"), "@javax.interceptor.Interceptors", bean.getEjbClass());
        annotationHelper.addWarning(warning);
      }
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

    }

    private void copySchedules(final List<Timer> timers, final List<MethodScheduleInfo> scheduleInfos) {
        final Map<NamedMethod, MethodScheduleInfo> methodScheduleInfoMap = new HashMap<NamedMethod, MethodScheduleInfo>();
        for (final Timer timer : timers) {
            final NamedMethod timeoutMethod = timer.getTimeoutMethod();
            MethodScheduleInfo methodScheduleInfo = methodScheduleInfoMap.get(timer.getTimeoutMethod());
            if (methodScheduleInfo == null) {
                methodScheduleInfo = new MethodScheduleInfo();
                methodScheduleInfoMap.put(timeoutMethod, methodScheduleInfo);
                methodScheduleInfo.method = toInfo(timeoutMethod);
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

        testBean.addPostConstruct("wrongMethod");
        ejbJar.addEnterpriseBean(new SingletonBean("TestSingleton", TestBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("FooStateful", FooBean.class));
        ejbJar.addEnterpriseBean(new StatefulBean("BarStateful", BarBean.class));
        final StatefulBean starBean = ejbJar.addEnterpriseBean(new StatefulBean("StarStateful", StarBean.class));
        starBean.setAfterBeginMethod(new NamedMethod("myAfterBegin"));
        starBean.setBeforeCompletionMethod(new NamedMethod("myBeforeCompletion"));
        starBean.setAfterCompletionMethod(new NamedMethod("myAfterCompletion"));
        return ejbJar;
    }
View Full Code Here

Examples of org.apache.openejb.jee.NamedMethod

        final List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
        final InterceptorBinding binding = new InterceptorBinding("wrongEjbName");
        // binding.setMethod(new NamedMethod("wrongMethod"));
        interceptorBindings.add(binding);
        final InterceptorBinding binding1 = new InterceptorBinding();
        binding1.setMethod(new NamedMethod("aMethod"));
        interceptorBindings.add(binding1);
        return ejbJar;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.