1 package org.apache.torque.avalon; 2 3 21 22 import java.sql.Connection ; 23 import java.util.Map ; 24 25 import org.apache.avalon.framework.component.Component; 26 import org.apache.torque.Database; 27 import org.apache.torque.TorqueException; 28 import org.apache.torque.adapter.DB; 29 import org.apache.torque.manager.AbstractBaseManager; 30 import org.apache.torque.map.DatabaseMap; 31 import org.apache.torque.map.MapBuilder; 32 33 40 public interface Torque 41 extends Component 42 { 43 46 String ROLE = Torque.class.getName(); 47 48 55 56 61 boolean isInit(); 62 63 68 org.apache.commons.configuration.Configuration getConfiguration(); 69 70 76 AbstractBaseManager getManager(String name); 77 78 86 AbstractBaseManager getManager(String name, String defaultClassName); 87 88 95 DatabaseMap getDatabaseMap() throws TorqueException; 96 97 107 DatabaseMap getDatabaseMap(String name) throws TorqueException; 108 109 114 void registerMapBuilder(String className); 115 116 122 void registerMapBuilder(MapBuilder builder); 123 124 132 MapBuilder getMapBuilder(String className) 133 throws TorqueException; 134 135 142 Connection getConnection() throws TorqueException; 143 144 151 Connection getConnection(String name) throws TorqueException; 152 153 165 Connection getConnection(String name, String username, String password) 166 throws TorqueException; 167 168 176 DB getDB(String name) throws TorqueException; 177 178 183 String getDefaultDB(); 184 185 190 void closeConnection(Connection con); 191 192 200 void setSchema(String name, String schema) throws TorqueException; 201 202 210 String getSchema(String name) throws TorqueException; 211 212 220 Database getDatabase(String databaseName) throws TorqueException; 221 222 234 Map getDatabases() throws TorqueException; 235 236 245 Database getOrCreateDatabase(String databaseName); 246 } 247 | Popular Tags |