# HG changeset patch # User František Kučera # Date 1318109538 -7200 # Node ID d883d4ab7b9dc2bb9f6cd7f70f1e763b963c9a7a # Parent be4e87479855c8d65d37aaf8e7c881497e07d832 Drupal: kostry tříd diff -r be4e87479855 -r d883d4ab7b9d src/org/sonews/storage/impl/DrupalDatabase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java Sat Oct 08 23:32:18 2011 +0200 @@ -0,0 +1,25 @@ +/* + * SONEWS News Server + * see AUTHORS for the list of contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sonews.storage.impl; + +/** + * + * @author František Kučera (frantovo.cz) + */ +public class DrupalDatabase extends JDBCDatabase { +} diff -r be4e87479855 -r d883d4ab7b9d src/org/sonews/storage/impl/DrupalDatabaseProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/sonews/storage/impl/DrupalDatabaseProvider.java Sat Oct 08 23:32:18 2011 +0200 @@ -0,0 +1,46 @@ +/* + * SONEWS News Server + * see AUTHORS for the list of contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sonews.storage.impl; + +import java.sql.SQLException; +import org.sonews.storage.Storage; +import org.sonews.storage.StorageBackendException; + +/** + * + * @author František Kučera (frantovo.cz) + */ +public class DrupalDatabaseProvider extends JDBCDatabaseProvider { + + @Override + public Storage storage(Thread thread) + throws StorageBackendException { + try { + if (!instances.containsKey(Thread.currentThread())) { + DrupalDatabase db = new DrupalDatabase(); + db.arise(); + instances.put(Thread.currentThread(), db); + return db; + } else { + return instances.get(Thread.currentThread()); + } + } catch (SQLException ex) { + throw new StorageBackendException(ex); + } + } +}