try {
Class localHomeInterface = bean.getLocalHomeInterface();
if (localHomeInterface != null) {
ObjectReference ref = new ObjectReference(bean.getEJBLocalHome());
String name = strategy.getName(bean.getLocalHomeInterface(), DEFAULT_NAME_KEY, JndiNameStrategy.Interface.LOCAL_HOME);
bind("openejb/local/" + name, ref, bindings, beanInfo, localHomeInterface);
optionalBind(bindings, ref, "openejb/Deployment/" + format(bean.getDeploymentID(), localHomeInterface.getName(), InterfaceType.EJB_LOCAL_HOME));
name = "openejb/Deployment/" + format(bean.getDeploymentID(), bean.getLocalInterface().getName());
bind(name, ref, bindings, beanInfo, localHomeInterface);
name = "openejb/Deployment/" + format(bean.getDeploymentID(), bean.getLocalInterface().getName(), InterfaceType.EJB_LOCAL);
bind(name, ref, bindings, beanInfo, localHomeInterface);
bindJava(bean, localHomeInterface, ref, bindings, beanInfo);
if (simpleNameRef == null) simpleNameRef = ref;
}
} catch (NamingException e) {
throw new OpenEJBRuntimeException("Unable to bind local home interface for deployment " + id, e);
}
try {
Class homeInterface = bean.getHomeInterface();
if (homeInterface != null) {
ObjectReference ref = new ObjectReference(bean.getEJBHome());
String name = strategy.getName(homeInterface, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.REMOTE_HOME);
bind("openejb/local/" + name, ref, bindings, beanInfo, homeInterface);
bind("openejb/remote/" + name, ref, bindings, beanInfo, homeInterface);