managedFactory = new ManagedEntityManagerFactory(actualFactory, kernelName);
String entityManagerJndiName = (String) props.get("jboss.entity.manager.jndi.name");
if (entityManagerJndiName != null)
{
EntityManager injectedManager = new TransactionScopedEntityManager(managedFactory);
NonSerializableFactory.rebind(initialContext, entityManagerJndiName, injectedManager, true);
}
String entityManagerFactoryJndiName = (String) props.get("jboss.entity.manager.factory.jndi.name");
if (entityManagerFactoryJndiName != null)
{