use of org.apache.openejb.jee.Interceptor in project tomee by apache.
the class EjbModuleOnlyInterceptorsTest method setUp.
@Module
public EjbJar setUp() throws Exception {
final EjbJar ejbJar = new EjbJar("bla");
ejbJar.addEnterpriseBean(new SingletonBean(InterceptorBean.class));
ejbJar.addEnterpriseBean(new SingletonBean(HistorySingletonBean.class));
ejbJar.addInterceptor(new Interceptor(InterceptorColor.class));
ejbJar.addInterceptor(new Interceptor(InterceptorJuice.class));
final AssemblyDescriptor assemblyDescriptor = new AssemblyDescriptor();
final InterceptorBinding binding = new InterceptorBinding("*", InterceptorJuice.class.getName(), InterceptorColor.class.getName());
assemblyDescriptor.addInterceptorBinding(binding);
ejbJar.setAssemblyDescriptor(assemblyDescriptor);
return ejbJar;
}
use of org.apache.openejb.jee.Interceptor in project tomee by apache.
the class SecondStatelessInterceptedTest method module.
@Module
public EjbJar module() {
final EjbJar ejbJar = new EjbJar();
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;
}
use of org.apache.openejb.jee.Interceptor in project tomee by apache.
the class CheckInvalidAroundTimeoutTest method testInvalidAroundTimeoutParameter.
@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;
}
Aggregations