1 2 12 package com.versant.core.jdo; 13 14 import javax.jdo.PersistenceManagerFactory; 15 import javax.jdo.JDOHelper; 16 import java.util.Properties ; 17 18 23 public class BootstrapPMF { 24 25 29 public static PersistenceManagerFactory getPersistenceManagerFactory(Properties props) { 30 String host = props.getProperty("versant.host"); 31 if (host == null) { 32 host = props.getProperty("host"); 33 if (host != null) { 34 props.setProperty("versant.host", host); 35 } 36 } 37 if (host != null && host.trim().length() > 0) { 38 props.setProperty( 39 "javax.jdo.PersistenceManagerFactoryClass", 40 "com.versant.core.jdo.remote.RemotePersistenceManagerFactory"); 41 return JDOHelper.getPersistenceManagerFactory(props, 42 BootstrapPMF.class.getClassLoader()); 43 } 44 return PersistenceManagerFactoryImp.getPersistenceManagerFactory(props); 45 } 46 47 } 48 49 50 | Popular Tags |