1 package org.apache.ojb.broker; 2 3 17 18 import org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory; 19 import org.apache.ojb.broker.util.configuration.Configurator; 20 import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator; 21 import org.apache.ojb.broker.metadata.MetadataManager; 22 23 31 public class PersistenceBrokerFactory 32 { 33 39 public static Configurator getConfigurator() 40 { 41 return OjbConfigurator.getInstance(); 42 } 43 44 50 public static void setDefaultKey(PBKey key) 51 { 52 MetadataManager.getInstance().setDefaultPBKey(key); 53 } 54 55 61 public static PBKey getDefaultKey() 62 { 63 return MetadataManager.getInstance().getDefaultPBKey(); 64 } 65 66 72 public static PersistenceBroker defaultPersistenceBroker() throws PBFactoryException 73 { 74 return PersistenceBrokerFactoryFactory.instance(). 75 defaultPersistenceBroker(); 76 } 77 78 87 public static PersistenceBroker createPersistenceBroker(String jcdAlias, 88 String user, 89 String password) throws PBFactoryException 90 { 91 return PersistenceBrokerFactoryFactory.instance(). 92 createPersistenceBroker(jcdAlias, user, password); 93 } 94 95 102 public static PersistenceBroker createPersistenceBroker(PBKey key) throws PBFactoryException 103 { 104 return PersistenceBrokerFactoryFactory.instance().createPersistenceBroker(key); 105 } 106 107 113 public static void releaseAllInstances() 114 { 115 PersistenceBrokerFactoryFactory.instance().releaseAllInstances(); 116 } 117 118 124 public static void shutdown() 125 { 126 PersistenceBrokerFactoryFactory.instance().shutdown(); 127 } 128 } 129 | Popular Tags |