* @see getContainer(Object)
* @param container a Container instance for the request.
*/
public PersistenceManagerFactory getPersistenceManagerFactory(Object container) {
Object rc = null;
PersistenceManagerFactoryImpl pmf = null;
ResourceReferenceDescriptor cmpResource = ((Container)container).getEjbDescriptor().
getEjbBundleDescriptor().getCMPResourceReference();
String name = cmpResource.getJndiName();
try {
InitialContext ic = new InitialContext();
rc = ic.lookup(name);
if (rc instanceof PersistenceManagerFactoryImpl) {
pmf = (PersistenceManagerFactoryImpl)rc;
} else if (rc instanceof javax.sql.DataSource) {
pmf = new PersistenceManagerFactoryImpl();
pmf.setConnectionFactoryName(ResourceInstaller.getPMJndiName(name));
Iterator it = cmpResource.getProperties();
if (it != null) {
while (it.hasNext()) {
NameValuePairDescriptor prop = (NameValuePairDescriptor)it.next();
String n = prop.getName();
// Any value that is not "true" is treated as "false":
boolean value = Boolean.valueOf(prop.getValue()).booleanValue();
pmf.setBooleanProperty(n, value);
}
}
} else {