final EjbModule module = new EjbModule(new EjbJar("openejb"), new OpenejbJar());
final OpenejbJar openejbJar = module.getOpenejbJar();
final EjbJar ejbJar = module.getEjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(null, DeployerEjb.class));
ejbJar.addEnterpriseBean(new StatelessBean(null, ConfigurationInfoEjb.class));
ejbJar.addEnterpriseBean(new StatelessBean(null, MEJBBean.class));
final String className = "org.apache.tomee.catalina.deployer.WebappDeployer";
if (exists(className)) {
final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean("openejb/WebappDeployer", className));
final EjbDeployment deployment = openejbJar.addEjbDeployment(bean);
deployment.getProperties().put("openejb.jndiname.format", "{deploymentId}{interfaceType.annotationName}");
}