final EjbJar ejbJar = new EjbJar();
final StatelessBean stateless = new StatelessBean(FooStateless.class);
stateless.setHomeAndRemote(FooStatelessHome.class, FooStatelessRemote.class);
stateless.setHomeAndLocal(FooStatelessLocalHome.class, FooStatelessLocal.class);
ejbJar.addEnterpriseBean(stateless);
final StatefulBean stateful = new StatefulBean(FooStateful.class);
stateful.setHomeAndRemote(FooStatefulHome.class, FooStatefulRemote.class);
stateful.setHomeAndLocal(FooStatefulLocalHome.class, FooStatefulLocal.class);
ejbJar.addEnterpriseBean(stateful);
final org.apache.openejb.jee.EntityBean bean = new org.apache.openejb.jee.EntityBean(MyEntity.class, PersistenceType.BEAN);
bean.setLocalHome(MyLocalHome.class.getName());
bean.setLocal(MyLocal.class.getName());
ejbJar.addEnterpriseBean(bean);
final org.apache.openejb.jee.EntityBean bean1 = new org.apache.openejb.jee.EntityBean(YourEntity.class, PersistenceType.BEAN);
bean1.setLocalHome(MyLocalHome.class.getName());
bean1.setLocal(MyLocal.class.getName());
ejbJar.addEnterpriseBean(bean1);
final StatelessBean bar = new StatelessBean(BarStateless.class);
bar.setHomeAndRemote(BarStatelessHome.class, BarStatelessRemote.class);
ejbJar.addEnterpriseBean(bar);
final StatefulBean bazStateful = new StatefulBean(BazStateful.class);
ejbJar.addEnterpriseBean(bazStateful);
return ejbJar;
}