use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class ThisInConstructorTest method bean.
@Module
public StatelessBean bean() {
final StatelessBean bean = new StatelessBean(AStatelessWithAConstructor.class);
bean.setLocalBean(new Empty());
return bean;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class FullyInterceptedTest method module.
@Module
public EjbJar module() {
final EjbJar ejbJar = new EjbJar();
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"));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class InterceptorBindingEjbTest method ejbJar.
/**
* aims to test that method level cdi interceptors are well managed (and not all merged in class level interceptors).
*
* @return the needed module
*/
@Module
public EjbModule ejbJar() {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean("ejb1", EJB1.class));
ejbJar.addEnterpriseBean(new StatelessBean("ejb2", EJB2.class));
final Beans beans = new Beans();
beans.addInterceptor(MarkedInterceptor.class);
final EjbModule module = new EjbModule(ejbJar);
module.setBeans(beans);
return module;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class MethodLevelInterceptorOnlyTest method module.
@Module
public EjbJar module() {
final EjbJar ejbJar = new EjbJar();
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;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class StatelessWithAroundInvokeOnlyTest method bean.
@Module
@Classes(cdi = true)
public StatelessBean bean() {
final StatelessBean bean = new StatelessBean(StatelessTestBean.class);
bean.setLocalBean(new Empty());
return bean;
}
Aggregations