use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class StatefulTransactionLockingTest method setUp.
@Override
protected void setUp() throws Exception {
System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
final ConfigurationFactory config = new ConfigurationFactory();
final Assembler assembler = new Assembler();
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
final StatefulSessionContainerInfo statefulContainerInfo = config.configureService(StatefulSessionContainerInfo.class);
statefulContainerInfo.properties.setProperty("AccessTimeout", "0 milliseconds");
// containers
assembler.createContainer(statefulContainerInfo);
// Setup the descriptor information
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(BlueStatelessBean.class));
ejbJar.addEnterpriseBean(new StatefulBean(RedStatefulBean.class));
ejbJar.addEnterpriseBean(new StatefulBean(LegacyStatefulBean.class));
assembler.createApplication(config.configureApplication(ejbJar));
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class StatelessConstructorInjectionTest method setUp.
protected void setUp() throws Exception {
super.setUp();
System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
final ConfigurationFactory config = new ConfigurationFactory();
final Assembler assembler = new Assembler();
assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
// containers
final StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
assembler.createContainer(statelessContainerInfo);
// Setup the descriptor information
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooBean.class));
final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
bean.getEnvEntry().add(new EnvEntry("count", Integer.class.getName(), "10"));
assembler.createApplication(config.configureApplication(new EjbModule(ejbJar).withCdi()));
}
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;
}
Aggregations